| 93 | } |
| 94 | |
| 95 | void F_First() |
| 96 | { |
| 97 | for (int k = 0; k < 1000; k++) |
| 98 | { |
| 99 | system("cls"); |
| 100 | cout << " C A L C U L A T I N G A R E A S\n" |
| 101 | << "-------------------------------------------\n" |
| 102 | << "1. Triangle\n" |
| 103 | << "2. Rectangle\n" |
| 104 | << "0. Back\n" |
| 105 | << "Your choice: \n"; |
| 106 | switch (_getch()) |
| 107 | { |
| 108 | // Case to Exit from the program |
| 109 | case 48: |
| 110 | { |
| 111 | system("cls"); |
| 112 | main(); |
| 113 | } |
| 114 | break; |
| 115 | |
| 116 | // First program |
| 117 | case 49: |
| 118 | { |
| 119 | system("cls"); |
| 120 | cout << " T R I A N G L E \n"; |
| 121 | cout << "----------------------------------\n"; |
| 122 | Shape *shape; // |
| 123 | Triangle triangle; |
| 124 | shape = ▵ // overriding functions for triangle |
| 125 | cout << "Enter the base: "; |
| 126 | cin >> b; |
| 127 | cout << "Entet the height: "; |
| 128 | cin >> h; |
| 129 | shape->get_data(b, h); |
| 130 | shape->display_area(); |
| 131 | cout << "-----------------------------------\n\n"; |
| 132 | system("pause"); |
| 133 | } |
| 134 | break; |
| 135 | |
| 136 | // second program |
| 137 | case 50: |
| 138 | { |
| 139 | system("cls"); |
| 140 | cout << " R E C T A N G L E \n"; |
| 141 | cout << "----------------------------------\n"; |
| 142 | Shape *shape; // |
| 143 | Rectanglee rectangle; |
| 144 | shape = &rectangle; |
| 145 | cout << "Enter the base: "; |
| 146 | cin >> b; |
| 147 | cout << "Entet the height: "; |
| 148 | cin >> h; |
| 149 | shape->get_data(b, h); |
| 150 | shape->display_area(); |
| 151 | cout << "------------------------------------\n\n"; |
| 152 | system("pause"); |
no test coverage detected