Answer to Question #332842 in C++ for Padi Tlhabane

Question #332842

A bookshop gives discount to customers as follows:



• Students get 10% discount,



• Book dealers get 12% discount and



• Pensioners get 15% discount.



• All other customers get 10% discount only if their total purchases are more than R200.



You are requested to write two versions of a program that calculates and displays the final amount that is



due, after discount.



(i) The first version of the program uses a switch statement to implement the above program.



(ii) The second version of the program uses nested-if statements.



Hint:



Use the following variables:



float amount; // the amount due before discount



char customerType; // the type of customer: 'S' (student) or



// 'D' (dealer) or 'P' (pensioner) or



COS1511/103/0/2022



5



// 'O'(other) float discount,


0
Service report
It's been a while since this question is posted here. Still, the answer hasn't been got. Consider converting this question to a fully qualified assignment, and we will try to assist. Please click the link below to proceed: Submit order

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS