Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void displayMenu();
- int getChoice();
- void computeFees(char*,double,int);
- void main() {
- int choice;
- int month;
- double rate;
- do {
- displayMenu();
- choice = getChoice();
- if (choice != 4) {
- if (choice ==1 ||choice==2 ||choice==3)
- {
- cout << "enter rate";
- cin >> month;
- switch (choice) {
- case 1: computeFees("adault", rate, month);
- break;
- case 2: computeFees("child", rate, month);
- break;
- case 3: computeFees("senior", rate, month);
- break;
- }
- }
- }
- }
- while (choice != 4);
- }
- void displayMenu() {
- cout << "\n\thealt clup memberchip \n\n";
- cout << "1.standart";
- cout << "2.child";
- cout << "3.senior";
- cout << "4.quit";
- }
- int getChoice() {
- int choice;
- cout << "enter choice";
- cin >> choice;
- while (choice < 1 || choice>4) {
- cout << "the only 1-4";
- cin >> choice;
- }
- return choice;
- system("pause");
- }
- void computeFees(char* membertype, double rate, int month) {
- cout << endl << "membership type" << membertype << "monthly rate " << rate << endl
- << "member of month " << month << endl << endl << "total charges" << rate*month << "tl"<<endl << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement