Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A salon offers coupons to its customers time to time. Without coupons adult hair

ID: 3744525 • Letter: A

Question

A salon offers coupons to its customers time to time. Without coupons adult haircut is 15.50 and the child haircut is 10.50. Coupons that this salon offers are color coded. The following table shows the color code and discount information Color code Green (code # 1) Blue (code # 2) Discount | 3.50 from adult, 2.50 from kids 259 from adult, 1.50 from kids Write a C+ program that asks the user to enter the coupon color and the haircut type (adult, kid) and then determine the haircut charge. It is possble that a customers may not have a coupon, in that case, no discount will be offered. You can assume that green, blue colors are represented using 1 and 2 respectively. Develop a C++ program that implements your algorithm

Explanation / Answer

#include using namespace std; int main() { int code, type; cout > code; cout > type; double discount, charge; if(type == 1){ charge = 15.50; } else { charge = 10.50; } if(code == 1) { if(type == 1) { discount = 3.5; } else { discount = 2.5; } } else if(code == 2) { if(type == 1) { discount = 2.59; } else { discount = 1.5; } } charge -= discount; cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote