### Console to GUI

How to recreate this program:

 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148`` ``````#include int main() { char menuinput, p2m; int plus1, plus2, plus3, min1, min2, min3, mul1, mul2, mul3; double div1, div2, div3; //main menu mainmenu: for (;;) { do { std::cout << "********************************************\nWelcome to Michael's Standard Calculator v1.\n********************************************\n\n\n\n"; std::cout << "Enter 1 for plus!\nEnter 2 for minus!\nEnter 3 for multiply\nEnter 4 for divi\nEnter q to quit (case sensitive)\n"; std::cin >> menuinput; } while (menuinput < '1' || menuinput > '4'&& menuinput != 'q'); //The actual calculators if (menuinput == 'q'){ goto Programend; } switch (menuinput) { //Plus calculator case '1': plus: std::cout << "Enter the first number: "; std::cin >> plus1; std::cout << "Enter the second number: "; std::cin >> plus2; plus3 = plus1 + plus2; std::cout << plus1 << " + " << plus2 << " = " << plus3 << "\n\n"; //Display plus std::cout << "Enter b to do another calculation\nEnter m to go back to the main menu\nEnter q to quit\n\n"; inv1: std::cin >> p2m; if (p2m == 'b') goto plus; else if (p2m == 'm') goto mainmenu; else if (p2m == 'q') goto Programend; else { std::cout << "You have selected an invalid option, please try again."; goto inv1; } break; case '2': minus: std::cout << "Enter the first number: "; std::cin >> min1; std::cout << "Enter the second number: "; std::cin >> min2; min3 = min1 - min2; std::cout << min1 << " - " << min2 << " = " << min3 << "\n\n"; //Display plus std::cout << "Enter b to do another calculation\nEnter m to go back to the main menu\nEnter q to quit\n\n"; inv2: std::cin >> p2m; if (p2m == 'b') goto minus; else if (p2m == 'm') goto mainmenu; else if (p2m == 'q') goto Programend; else { std::cout << "You have selected an invalid option, please try again."; goto inv2; } break; case '3': multiply: std::cout << "Enter the first number: "; std::cin >> mul1; std::cout << "Enter the second number: "; std::cin >> mul2; mul3 = mul1 * mul2; std::cout << mul1 << " X " << mul2 << " = " << mul3 << "\n\n"; //Display plus std::cout << "Enter b to do another calculation\nEnter m to go back to the main menu\nEnter q to quit\n\n"; inv3: std::cin >> p2m; if (p2m == 'b') goto multiply; else if (p2m == 'm') goto mainmenu; else if (p2m == 'q') goto Programend; else { std::cout << "You have selected an invalid option, please try again.\n"; goto inv3; } break; case '4': division: std::cout << "Enter the first number: "; std::cin >> div1; std::cout << "Enter the second number: "; std::cin >> div2; div3 = div1 / div2; std::cout << div1 << " X " << div2 << " = " << div3 << "\n\n"; //Display plus std::cout << "Enter b to do another plus calculation\nEnter m to go back to the main menu\nEnter q to quit"; inv4: std::cin >> p2m; if (p2m == 'b') goto division; else if (p2m == 'm') goto mainmenu; else if (p2m == 'q') goto Programend; else { std::cout << "You have selected an invalid option, please try again.\n"; goto inv4; } break; } } //Program end! Programend: std::cout << "Thank you for using the program! ENTER ANY KEY TO QUIT! "; std::cin.get(); std::cin.ignore(); return 0; }``````

into a GUI program? I'm sorry if the grammar use in this post is poor, but unfortunately English is not my first language.
what you mean like installing SDL and making buttons?
Michail,

You are going about it the wrong way. To accomplish your goal, you need to first learn GUI programming. That could take anywhere from several months to a year depending on your background and the tools you decide to use. After learning how to create GUI windows, buttons, text boxes, etc., then you would tackle creating a calculator.

Fred
Topic archived. No new replies allowed.