List the names of subroutines of the hierarchy chart, and then write complete ps
ID: 674725 • Letter: L
Question
List the names of subroutines of the hierarchy chart, and then write complete pseudocode for the following problem. You will not have to create a data dictionary for this exercise. Problem: Customers get a discount on their restaurant bill. The discount is based on a customers age and a frequent diner card. A customer whose age is 55 or greater and who shows a diner card is eligible for 15% discount on the restaurant bill. A customer whose age is 55 or greater but without a diner card is eligible for a 5% discount on the restaurant bill. A customer with a diner club card is eligible for a 10% discount. Produce the pseudocode logic for an algorithm that will compute the discount for each customer. The information is given as follows: - The output will consist of a screen display showing the customer's discount received. - The input will consist of the keyboard input containing the customer's age, diner club number, and restaurant bill amount. - The processing will compute the discount received by each eligible customer. If the customer is not a senior or does not have a diner card, there should be no discount on the restaurant bill.
Explanation / Answer
Pseudocode to calculate the discount amount of customer bill based on the age and club diner card
1.Declare age variable
2.Declare dinerClubNumber variable
3.Declare billAmount variable
4.Declare and initialiaze the discountAmount=0
5.Declare discount variable
6.Read age of customer
7.Do you have diner club card number
8.Read either y or n for customer hadDinerCard .
9.Read billAmount
10
IF age >=55 AND hadDinerCard=='y',
THEN discount=0.15
. ELSE IF age >=55 AND hadDinerCard=='n',
THEN discount=0.5
ELSE IF hadDinerCard=='y',
THEN discount=0.10
11.Calculate discountAmount=billAmount*discount
12.Display "Age" , age
13.Display "Bill " ,billAmount
14.Display "Discount Amount ", discountAmount
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.