university of carolina programming help Complete the Lab 4-6, \"Programming Chal
ID: 3914620 • Letter: U
Question
university of carolina programming help 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. file attached below. Thats for homework 1 2 Homework The university reassessed its needs for the website design and determined it will no longer require all students to take five classes. Update the website program to reflect the following changes: Prompt the student for the number of courses being taken Use a while loop to prompt the student for the price of each book based upon the number of classes being taken After the price of each book has been entered, prompt the user for shipping options: delivery or pick-up Use an if statement to add the charges to the total price if the shipping charges are greater than 0 Display the total cost Create a 1/2- to 1-page document containing pseudocode based on the revised program needs. Add this to the revised program pseudocode from the Week One Individual Assignment, Problem Solving with Algorithms. Create a 1-page flowchart based on the algorithm for the revised program needs. Add this to the revised program flowchart from the Week One Individual Assignment, Problem Solving with Algorithms.
here is content of the attatchment... kindly keenly look at it thank you.
Lab 4: Decisions and Boolean Logic
This 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 Total
Write 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 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 <= 5.99:
tip = mealprice * .10
elif mealprice >= 6 and mealprice <=12:
tip = mealprice * .13
elif mealprice >=12.01 and mealprice <=17:
tip = mealprice * .16
elif mealprice >= 17.01 and mealprice <=25:
tip = mealprice * .19
else:
tip = mealprice * .22
return tip
#this function will calculate tax at 6%
def calc_tax(mealprice):
tax = mealprice * .06
return tax
#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 total
def 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()
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%
Explanation / Answer
here is the complete pseudocode as per the requirement.
=========================================================
Pseudocode:
=========================================================
here is the complete pseudocode for the given example
Start:
define a main function
print heading welcome to the tip and tax calculator program
print a blank line
input a meal price
calculate tip by calling the cal_tip function and store the return value to a variable tip
calculate the tax by calling the cal_tax function and store the return value to tax variable
calculate the total by calling the cal total function and store the total into total variable
print information mealprice tip, tax and total
defination of the functions goes here
definition of input meal function
input meal price
convert the meal price to a float value
return mealprice to calling function
definition of cal_tip function this function will calculate tip at 20 percent
if mealprice is greater than or equal to .01 and the mealprice is less than equal to 5.99
tip = mealprice multiply by .10
else if mealprice is greater than or equal to 6 and the mealprice is less than equal to 12
tip = mealprice multiply by .13
else if mealprice is greater than or equal to 12.01 and the mealprice is less than equal to 17
tip = mealprice multiply by .16
else if mealprice is greater than or equal to 17.01 and the mealprice is less than equal to 25
tip = mealprice multiply by .19
else
tip = mealprice multiply by .22
return tip to calling function
this function cal_tax will accept meal price as parameter calculate tax at 6%
tax = mealprice multiplied by .06
return tax to calling function
defintion of the cal_total function
this function accept the parameters tip, tax and the meal price and calculate total
total = mealprice+tip+tax
return total to calling function
definition of the function to print the mealprice, tip, tax and the total
print the meal price in dollers
print the tip in dollers
print the tax in dollers
print the total in dollers
call to main function
END
========================================================
Kindly Check and Verify Thanks..!!!
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.