| 166 | } |
| 167 | |
| 168 | void F_Second() |
| 169 | { |
| 170 | for (int k = 0; k < 1000; k++) |
| 171 | { |
| 172 | system("cls"); |
| 173 | cout << " S E C O N D P R O G R A M\n" |
| 174 | << "-------------------------------------\n" |
| 175 | << "1. Triangle\n" |
| 176 | << "2. Rectangle\n" |
| 177 | << "3. Circle\n" |
| 178 | << "0. Back\n" |
| 179 | << "Your choice: \n"; |
| 180 | switch (_getch()) |
| 181 | { |
| 182 | // Case to Exit from the program |
| 183 | case 48: |
| 184 | { |
| 185 | system("cls"); |
| 186 | main(); |
| 187 | } |
| 188 | break; |
| 189 | |
| 190 | // First program |
| 191 | case 49: |
| 192 | { |
| 193 | system("cls"); |
| 194 | cout << " T R I A N G L E \n"; |
| 195 | cout << "----------------------------------\n"; |
| 196 | Shape *shape; // |
| 197 | Triangle triangle; |
| 198 | shape = ▵ // overriding functions for triangle |
| 199 | cout << "Enter the base: "; |
| 200 | cin >> b; |
| 201 | cout << "Entet the height: "; |
| 202 | cin >> h; |
| 203 | shape->get_data(b, h); |
| 204 | shape->display_area(); |
| 205 | cout << "-----------------------------------\n\n"; |
| 206 | system("pause"); |
| 207 | } |
| 208 | break; |
| 209 | |
| 210 | // second program |
| 211 | case 50: |
| 212 | { |
| 213 | system("cls"); |
| 214 | cout << " R E C T A N G L E \n"; |
| 215 | cout << "----------------------------------\n"; |
| 216 | Shape *shape; // |
| 217 | Rectanglee rectangle; |
| 218 | shape = &rectangle; |
| 219 | cout << "Enter the base: "; |
| 220 | cin >> b; |
| 221 | cout << "Entet the height: "; |
| 222 | cin >> h; |
| 223 | shape->get_data(b, h); |
| 224 | shape->display_area(); |
| 225 | cout << "------------------------------------\n\n"; |
no test coverage detected