MCPcopy Create free account
hub / github.com/Rustam-Z/cpp-programming / F_Second

Function F_Second

Lab_18/main.cpp:168–257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168void 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 = &triangle; // 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";

Callers 1

mainFunction · 0.85

Calls 3

get_dataMethod · 0.80
mainFunction · 0.70
display_areaMethod · 0.45

Tested by

no test coverage detected