Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void displayMenu();
  5.  
  6. int getChoice();
  7.  
  8.  
  9. void computeFees(char*,double,int);
  10.  
  11.  
  12. void main() {
  13.  
  14. int choice;
  15. int month;
  16. double rate;
  17. do {
  18. displayMenu();
  19. choice = getChoice();
  20. if (choice != 4) {
  21. if (choice ==1 ||choice==2 ||choice==3)
  22. {
  23. cout << "enter rate";
  24. cin >> month;
  25. switch (choice) {
  26. case 1: computeFees("adault", rate, month);
  27. break;
  28.  
  29. case 2: computeFees("child", rate, month);
  30. break;
  31. case 3: computeFees("senior", rate, month);
  32. break;
  33. }
  34. }
  35. }
  36. }
  37. while (choice != 4);
  38. }
  39. void displayMenu() {
  40. cout << "\n\thealt clup memberchip \n\n";
  41. cout << "1.standart";
  42. cout << "2.child";
  43. cout << "3.senior";
  44. cout << "4.quit";
  45.  
  46. }
  47. int getChoice() {
  48.  
  49. int choice;
  50. cout << "enter choice";
  51. cin >> choice;
  52. while (choice < 1 || choice>4) {
  53. cout << "the only 1-4";
  54. cin >> choice;
  55.  
  56. }
  57. return choice;
  58. system("pause");
  59. }
  60. void computeFees(char* membertype, double rate, int month) {
  61.  
  62. cout << endl << "membership type" << membertype << "monthly rate " << rate << endl
  63. << "member of month " << month << endl << endl << "total charges" << rate*month << "tl"<<endl << endl;
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement