Guys am new in the field of c++ programming since I finished my college I decided to start programming
but their is a step I have reached and am stalk I have made my simple program amd I wanted to put it
in GU. Am using Linux Ubuntu and I would like to put my program in GU am tired of nicked programs
How can I get GU and how can I install it in linux ubuntu
Here is my program which I want to put in GU and you can tell me how is supposed to be

// SIMPLE CALUCULATION IN C++ PROGRAMMING
#include <iostream>
#include <cstdlib>
#include <cmath>

using namespace std;
int main ()
{
      while (true) {
        signed long int num1, num2;
        signed long int ans;
        cout << "S7 CALCULATOR" <<endl;
        cout << "----------------";
        cout <<endl; 
        cout << "1.Add."<<endl;
        cout << "2.Substraction."<<endl;
        cout << "3.Multiplication."<<endl;
        cout << "4.Division."<<endl;
        cout << "5.Exist program."<<endl;
        cout << endl;

        cout << "\tChose your option(1-5):";
        cin >> ans;


      if (ans == 1)
         {
           cout << "(Addition)"<<endl;
           cout << endl;
           cout << "Enter the first num:";
           cin>> num1;
           cout << "Enter the second num:";
           cin >> num2;
           cout << endl;
           cout << "The answer is:" << num1 + num2;
           cout <<endl;
           }


            if (ans == 2)
            {
             cout << "(Substraction)"<<endl;
             cout << endl;
             cout << "Enter the first num:";
             cin >> num1;
             cout << "Enter the second num:";
             cin >> num2;
             cout << "The answer is:" << num1 - num2;
             cout <<endl;
             }

             if (ans == 3)
              {
                cout << "(Multiplication)"<<endl;
                cout << endl;
                cout << "Enter the first num:";
                cin >> num1;
                cout << "Enter the second num:";
                cin >> num2;
                cout <<endl;
                cout << "The answer is:" << num1 * num2;
                cout <<endl;
               }

               if (ans == 4)
              {
                 cout << "(Division)"<<endl;
                 cout << endl;
                 cout << "Enter the first num:";
                 cin >> num1;
                 cout << "Enter the second num:";
                 cin >> num2;
                 cout << endl;
                 cout << "The answer is:" << num1 / num2;
                 cout <<endl;
               }

                        if (ans == 5)
                        {
                          cout <<"\tExit program";
                          cout << "\tThank you:\n";
                          exit (1);
                          }
                          }

                          return 0;
                          }

Dani AI

Generated

asked what "GU" meant — it's almost certainly "GUI" (graphical user interface). posted a console C++ calculator and wants to convert it into a GUI app on Ubuntu; the usual choices are to (1) pick a C++ GUI toolkit, (2) install the toolkit/dev packages, (3) design the UI (visual editor or code), and (4) move the calculation logic into event handlers. (en.wikipedia.org)

Common, well-supported options on Ubuntu:

  • Qt (rich, cross‑platform, Qt Creator includes a visual UI designer and project templates). (packages.ubuntu.com)
  • GTK with the gtkmm C++ bindings (works naturally on GNOME; Glade is a GUI builder that produces GtkBuilder XML). (launchpad.net)
  • wxWidgets (native-look widgets, packaged for Ubuntu). (packages.ubuntu.com)
  • For very small GUI wrappers (dialogs/inputs) use Zenity / kdialog / yad instead of a full C++ UI. (launchpad.net)

Quick install examples (example commands; package names can vary by Ubuntu release):

Install Qt (IDE + dev files)

sudo apt update
sudo apt install build-essential qtcreator qtbase5-dev

(see qtcreator / qtbase5-dev packages). (packages.ubuntu.com)

Install gtkmm + Glade

sudo apt install build-essential libgtkmm-3.0-dev glade

(see libgtkmm and Glade packaging). (launchpad.net)

Quick dialog tool

sudo apt install zenity

(zenity packaged in Ubuntu). (launchpad.net)

Practical workflow notes: use the visual designer (Qt Designer inside Qt Creator, or Glade) to lay out buttons/fields, then move the calculator logic into signal handlers (button-click callbacks). Validate inputs (check divisor before division, avoid silent integer overflow, consider using floating point for division), and test the compiled binary. Example compile invocation for gtkmm programs uses pkg-config to get flags: g++ prog.cc -o prog \pkg-config --cflags --libs gtkmm-3.0``. (sources.debian.org)

Common pitfalls: Qt Creator may show "no kits" if the system Qt dev packages are missing — install the Qt base dev packages or use the official Qt installer; gtkmm programs need the -dev packages and pkg-config flags. (askubuntu.com)

Summary: for a beginner converting a small calculator, Qt + Qt Creator is the easiest path for a full GUI; gtkmm+Glade is a lightweight C++ alternative; zenity is fastest for simple dialogs. The calculation core can be reused verbatim inside GUI callbacks after adding input validation.

What is 'GU'?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.