In: Computer Science
Selection/Conditional Structure: Create a flowchart and pseudocode for the problem below:
Juan dela Cruz Restaurant is offering a 20% discount to all customers whose last name is also dela Cruz. Input the last name of the customer and the total amount due to the customer and then output the amount to be paid.
(C++ Program, choose only the LAST NAME)
Flow Chart
Pseudo Code
Variables Used:
lastName is string
totalAmount, amountDue are numeric
Begin
Display ” Input customer’s last name and amount due: ”
Read lastName, amountDue
if ( lastName == “dela Cruz”) then
begin
totalAmount = amountDue– amountDue *0.2
Print “ You have a 20% discount ”
Print “ Amount to be paid = ”, totalAmount
end
else
begin
totalAmount = amountDue
Print “ You don’t have 20% discount ”
Print “ Amount to be paid = ”, totalAmount
end
End