Old MathJax webview
Activity Instructions Instructions Directions: Create a program in C++. 1. Use the given source codes in this lesson to create your own program (i.e: Point of Sale, Billing System, Grading System, & etc...) 2. Save it as Case Study.cpp a Prepare answer Consider the following source codes. Write it, compile program output that you want and make it better. SAMPLE SOURCE CODES: #include
#include #include using namespace std; class Cstudy { public: void g(int x, int y) { HANDLE Con; COORD Cur; Cur.X=x; Cur.YEY: Con=GetstdHandle (STD OUTPUT HANDLE) ; SetConsolecursorPoeition (Con, Cur); } char choice; float x, y, dollar, peso; Add 0 11 system("cls"); g (20, 2); cout>x; g (20,5); cout>y: g (20,7); cout>choice, if (toupper (choice) = 1 Ada el se Math(); } Sub { system("cls"); g(20,2); cout>x; g (20,5); cout>y; g (20,7); cout>choice; { if (toupper (ehoice) Subo; else Math(); } } Mal 0 system("cls"); g (20,2); cout>ehoice; if (touppertchoicet ty ') else Math(); O LU view Div() { system("cls"); g (20, 2); cout>x; g (20,5); cout>y; g (20,7); cout>choice; if (toupper (choice) Divo else Math(); } "/: void Math () { system("cls"); g (20,2); cout"; cin>>choice; { if (toupper (choice) == '1') Add(); if(toupper (choice) == "21) Sub(); if (toupper (choice) == '3') Mul(); if(toupper (choice) == '4') ( Div(); else menu () ; 3 GU dollarpeso () { system("cls"); g(20,3);cout>dollar; g (20,6); cout>choice; if (toupper(choice) dollarpe sos; else Con(); pesodollar() { system("cls"); g (20,3); cout>peso; g (20,6); cout>choice; if (toupper (choice) == MY pesodollar(); Con(); } Con (1) C 9y3tem("cls"); g (20,2) ; coutcheide if (toupper(ca cel '1') () 1 dollarpeso ); if(toupper cience) pegodollar(); else return 0; } { GATELLEN zystem("els"); 120.5); cout "; cin>>choice; { if(toupper (choice) == 'A') Math(); if(toupper(choice) == 'B') Con ( ) ; if(touppertohoice == '0') () C Sure ( } } }; Activity Instructions Instructions Directions: Create a program in C++. 1. Use the given source codes in this lesson to create your own program (i.e: Point of Sale, Billing System, Grading System, & etc...) 2. Save it as Case Study.cpp a Prepare answer Consider the following source codes. Write it, compile program output that you want and make it better. SAMPLE SOURCE CODES: #include #include #include using namespace std; class Cstudy { public: void g(int x, int y) { HANDLE Con; COORD Cur; Cur.X=x; Cur.YEY: Con=GetstdHandle (STD OUTPUT HANDLE) ; SetConsolecursorPoeition (Con, Cur); } char choice; float x, y, dollar, peso; Add 0 11 system("cls"); g (20, 2); cout>x; g (20,5); cout>y: g (20,7); cout>choice, if (toupper (choice) = 1 Ada el se Math(); } Sub { system("cls"); g(20,2); cout>x; g (20,5); cout>y; g (20,7); cout>choice; { if (toupper (ehoice) Subo; else Math(); } } Mal 0 system("cls"); g (20,2); cout>ehoice; if (touppertchoicet ty ') else Math(); O LU view Div() { system("cls"); g (20, 2); cout>x; g (20,5); cout>y; g (20,7); cout>choice; if (toupper (choice) Divo else Math(); } "/: void Math () { system("cls"); g (20,2); cout"; cin>>choice; { if (toupper (choice) == '1') Add(); if(toupper (choice) == "21) Sub(); if (toupper (choice) == '3') Mul(); if(toupper (choice) == '4') ( Div(); else menu () ; 3 GU dollarpeso () { system("cls"); g(20,3);cout>dollar; g (20,6); cout>choice; if (toupper(choice) dollarpe sos; else Con(); pesodollar() { system("cls"); g (20,3); cout>peso; g (20,6); cout>choice; if (toupper (choice) == MY pesodollar(); Con(); } Con (1) C 9y3tem("cls"); g (20,2) ; coutcheide if (toupper(ca cel '1') () 1 dollarpeso ); if(toupper cience) pegodollar(); else return 0; } { GATELLEN zystem("els"); 120.5); cout "; cin>>choice; { if(toupper (choice) == 'A') Math(); if(toupper(choice) == 'B') Con ( ) ; if(touppertohoice == '0') () C Sure ( } } }