[
Code:
1 #include<iostream>
2 #include<cctype>
3 usingnamespace std;
4
5 int main()
6 {
7 char choice;
8 double charges;
9 double units;
10 double package_A, package_B, package_C;
11
12 do
13 {
14 cout <<"Which pakage are you shopping for?:Please enter A, B, C, or Q to quit."<< endl;
15 cin>> choice;
16 cout <<"How many message units?:"<< endl;
17 cin>>units;
18 while(unit <= 672);
19 cout<<"Enter a number from 0 through 672 for message units."<<endl;
20 choice = toupper(choice);
21 }while(choice !='A' && choice !='B' && choice !='C' && choice !='Q');
22 (unit <= 672);
23 switch(choice)
24 {
25 case'A':
26
27 cout<<"How many massage units?:"<<endl;
28 cin>>units;
29
30 if (unit <=10)
31
32 charges = 9.95
33 else
34 (unit > 10)
35
36 charges = (unit * 2) + 9.95;
37 cout<<"The charges are:"<< charges<< endl;
38 break;
39
40 case'B':
41
42 cout<<"How many massage units?:"<<endl;
43 cin>>units;
44
45 if (unit <= 20)
46 charges = 19.95;
47
48 else (unit >20)
49 charges = (unit - 20) + 19.95;
50 cout<<"The charges are:"<< charges<< endl;
51
52 break;
53 case'C':
54
55 cout<<"How many massage units?:"<<endl;
56 cin>>units;
57
58 charges = 39.95;
59 break;
60
61 case'Q':
62
63 cout<<"How many massage units?:"<<endl;
64 cin>>units;
65
66 cout<<"Thank you for using this program. Goodbye."<< endl;
67 break;
68 default:
69 cout<<"Enter only A, B, C, or Q."<<endl;
70 }
71
72 if (A < B && A > C)
73 plan = (pakage_A - pakage_B);
74 cout<<"By switching to Package A you would save:$"<< plan<<endl;
75
76 elseif (pakage_B < pakage_C)
77
78 cout<<"By switching to Package B you would save:$"<< plan<<endl;
79
80 else
81 cout<<"By switching to Package C you would save:$"<< plan<<endl;
82
83 }
84
85 return 0;
86
87 }