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.
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()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started