Question
Write pseudocode that will calculate a XXX% tip and a 6% tax on a meal price. The user will enter the meal price and the
Write pseudocode that will calculate a XXX% tip 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 restaurant now wants to change the program so that the tip percent is based on the meal price. The new amounts 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% |
Use the following the stricture
// main module
Module main()
// Local variables
Declare Integer Seconds, Days, Hours, Minutes
// Get the inputSeconds
Call getSeconds(Seconds)
// Calculate the days
If Seconds >= 86400 Then
Set Days = Seconds / 86400
Set Seconds = Seconds (Days * 86400)
End If
// Calculate the hours
If Seconds >= 3600
Set Hours = Seconds / 3600
Set Seconds = Seconds (Hours * 3600)
End If
// Calculate the minutes
If Seconds >= 60
Set Minutes = Seconds / 60
Set Seconds = Seconds (Minutes * 60)
End If
// Display days, hours, minutes, seconds
Call showTime(Seconds, Days, Hours, Minutes)
End Module
// The getSeconds module gets seconds and stores it
// in the inputSeconds reference variable.
Module getSeconds(Integer Ref inputSeconds)
Display Enter the seconds.
Input inputSeconds
End Module
// The showTime module accepts Seconds, Days, Hours, Minutes
// as arguments and displays the number of each
Module showTime (Integer Seconds, Days, Hours, Minutes)
Display "Days: ", Days
Display "Hours: ", Hours
Display "Minutes: ", Minutes
Display "Seconds: ", Seconds
End Module
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