This description is the following code that was used to find what the total price was for this meal, making it clear this was the final coding that was used for the price. The meal = 44.50 on line 3 is how much the price the meal was. The line after shows the percentage of tax in decimal form which was 6.75 which was converted to decimal form of course to make it classified as a boolean. The next line shows the tip equaling in decimal form (boolean). Together with all three booleans we will find the total price of the meal in which the next line will indicate you the final price of this meal. This lab had to do mostly with using math skills and using python skills like booleans and so on but here we will find the solution of the final price and and show you step by step in the next section how i got the final result. This is lab 1 python first lab we will introduce a program called python.
The following is the code that i typed in codeacademy to show what the result of the cost in total of the meal was. By using codeacademy meal section i did this unit to figure out the total cost and as see this is the code and final cost of the meal. First things first we had to figure out the price of the total of the meal this person had purchased. The meal cost 44.50 as you see there however the tax was 0.0675 and also its tip we cant forget that was 0.15. Next we would have to combine or add all of those prices using addition in python! excepyt you had to multiply in some part for the tax not multiplying but doing a special operation of python that uses this *. Then when we add all and multiply these 3 prices we get a result that is 54.63 the final cost of this meal that was purchased. To prove how we got the answer we typed in print (“%2f % total), This is like a reference to figure out how we got the answer in python or codeacademy. That concludes the end of the lab 1 python of tip calculator.
# Assign the variable total on line 8! meal = 44.50 tax = 0.0675 tip = 0.15 meal = meal + meal * tax total = 54.63 print("%.2f" % total)
This is the screenshot of the following total of the price of the meal plus its tax and tip and so on, here it gives the total price. And the total price of this meal is 54.63 in boolean form, how i found the answer to the meal, i added the prices of all three that consisted the meal and the other meal plus its tax and there when you add all it will then tell you that the total is mentioned here above which is 54.63. Also i have here two screenshots… which one shows the screenshot of the console and another shot of the actual codeacademy final part of the lab and as you can see it shows the coding and also the final price to the right which is the console (box in the right).