I have to make a program with switch like this: Adventist University of Central America are charged according to the area of study for the career of Engineering systems are $ 1,800 per semester, for the career of Business Administration are $ 1,780 per semester, for the career of mathematics education is $ 1,600 per semester and nursing career are $ 2000, creates a program that determines the value of the career by area chosen taking into account that if the student is Adventist has a 10% discount and if you have more than one brother studying at the University has another 10% off. Eventually display discounts and total payable.
1
Expert's answer
2012-11-08T06:47:38-0500
#include <iostream> #include <conio.h> using namespace std;
int main () { int choice; double totalCost = 0; char discount; cout<<"1) Career of Engineering system" << endl; cout<<"2) Business Administration" << endl; cout<<"3) Career of mathematics education" << endl; cin >> choice; switch(choice) { case 1 : totalCost = 1800; cout<<"Are you Adventist ? (y/n)" << endl; cin >> discount; if (discount = 'y'){ totalCost-=totalCost*0,1; } cout<<"Do you have more then 1 brother already studying ?(y/n)" << endl; cin >> discount; if (discount = 'y'){ totalCost-=totalCost*0,1; } cout<<"Total cost = $"<< totalCost << endl; break; case 2 : totalCost= 1780; cout<<"Are you Adventist ? (y/n)" << endl; cin >> discount; if (discount = 'y'){ totalCost-=totalCost*0,1; } cout<<"Do you have more then 1 brother already studying ?(y/n)" << endl; cin >> discount; if (discount = 'y'){ totalCost-=totalCost*0,1; } cout<<"Total cost = $"<< totalCost << endl; break; case 3: totalCost = 2000; cout<<"Are you Adventist ? (y/n)" << endl; cin >> discount; if (discount = 'y'){ totalCost-=totalCost*0,1; } cout<<"Do you have more then 1 brother already studying ?(y/n)" << endl; cin >> discount; if (discount = 'y'){ totalCost-=totalCost*0,1; } cout<<"Total cost = $"<< totalCost << endl; break; } system("pause"); return 0; }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment