Tip Calculator

In this activity it was required that we had to declare a variable, “meal.” We then had to assign it a value of 44.50. After we completed this we had to continue by creating another variable, “tax,” and assign that a value of 6.75%and when writing it in python format we had to write 6.75/100 to represent it. After completing this step we had to create a third variable, “tip,” and make it equal to 15% which we would type out as .15. Then we had to reassign the variable, “meal” to the value of itself, 44.50, and then multiply it to the tax, 6.75/100. When writing this out it looked like this, ‘meal = 44.50 + 44.50 * 6.75 / 100.’ Lastly we had to assign the variable, “total” to meal(X2) and multiply it by the tip. When typed out it looked like this,

total = meal + meal * tip.  After writing this we pressed print and the code printed the value of the total.

 

Overall, this assignment was pretty simple. I had done this same activity in high school but i had forgot most of what i had done back then. It was nice to refresh my memory of what i had learned.