Lab 4: Decisions and Boolean LogicThis lab accompanies Chapter 4 of Gaddis, T. (2016). Starting out with programming logic and design (4th ed.). Boston, MA: Addison-Wesley.Lab 4.6 – Programming...




Lab 4: Decisions and Boolean LogicThis lab accompanies Chapter 4 of Gaddis, T. (2016).
Starting out with programming logic and design
(4th ed.). Boston, MA: Addison-Wesley.Lab 4.6 – Programming Challenge 1 – Tip, Tax, and TotalWrite the Pseudocode for the following programming problem. Write a program that will calculate a tip based on the meal price and a 6% tax on a meal price. The user will enter the meal price and the program will calculate tip, tax, and the total. The total is the meal price plus the tip plus the tax. Your program will then display the values of tip, tax, and total.The tip amounts based on the mean price are as follows:































Meal Price Range



Tip Percent



.01 to 5.99



10%



6 to 12.00



13%



12.01 to 17.00



16%



17.01 to 25.00



19%



25.01 and more



22%





The Pseudocode



TYPE PSEUDOCODE HERE


The Python Code for Reference


#the main functiondef main(): print 'Welcome to the tip and tax calculator program' print #prints a blank line mealprice = input_meal() tip = calc_tip(mealprice) tax = calc_tax(mealprice) total = calc_total(mealprice, tip, tax) print_info(mealprice, tip, tax, total) #this function will input meal price def input_meal(): mealprice = input('Enter the meal price $') mealprice = float(mealprice) return mealprice #this function will calculate tip at 20% def calc_tip(mealprice): if mealprice >= .01 and mealprice <=>= 6 and mealprice <=12:>=12.01 and mealprice<=17:>= 17.01 and mealprice <=25:>


#this function will calculate tip, tax, and the total cost def calc_total(mealprice, tip, tax): total = mealprice + tip + tax return total #this function will print tip, tax, the mealprice, and the totaldef print_info(mealprice, tip, tax, total): print 'The meal price is $', mealprice print 'The tip is $', tip print 'The tax is $', tax print 'The total is $', total #calls main


main() Complete the Lab 4-6, "Programming Challenge 1 - Tip, Tax, and Total," of
Starting Out
with Programming Logic and Design.Note:
You are only required to create the pseudocode for this activity; however, notice how the pseudocode compares to the given Python code for this assignment. Lab 4: Decisions and Boolean LogicThis lab accompanies Chapter 4 of Gaddis, T. (2016).
Starting out with programming logic and design
(4th ed.). Boston, MA: Addison-Wesley.


Lab 4.6 – Programming Challenge 1 – Tip, Tax, and TotalWrite the Pseudocode for the following programming problem. Write a program that will calculate a tip based on the meal price and a 6% tax on a meal price. The user will enter the meal price and the program will calculate tip, tax, and the total. The total is the meal price plus the tip plus the tax. Your program will then display the values of tip, tax, and total.The tip amounts based on the mean price are as follows:
































Meal Price Range



Tip Percent



.01 to 5.99



10%



6 to 12.00



13%



12.01 to 17.00



16%



17.01 to 25.00



19%



25.01 and more



22%





The Pseudocode



TYPE PSEUDOCODE HEREThe Python Code for Reference #the main function def main(): print 'Welcome to the tip and tax calculator program' print #prints a blank line



mealprice = input_meal() tip = calc_tip(mealprice) tax = calc_tax(mealprice)



total = calc_total(mealprice, tip, tax) print_info(mealprice, tip, tax, total) #this function will input meal price def input_meal(): mealprice = input('Enter the meal price $') mealprice = float(mealprice) return mealprice #this function will calculate tip at 20% def calc_tip(mealprice): if mealprice >= .01 and mealprice <=>



elif mealprice >= 6 and mealprice <=12:>=12.01 and mealprice <=17:>= 17.01 and mealprice <=25:>



May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here