Hi everyone

I have a small program on ATM transaction that i did on console application in C++ and i am having difficulty converting it to GUI and i dont understand why.Here is the code if you can do it plz send me the coding i will gladly appreciate it

#include<iostream.h>
#include<conio.h>

void main()
{
char indent;


Savings saving[3];
Checking check[3];
Account accoun[3];
int num=1001;
float moo;
for(int x=0;x<3;x++)
{
cout<<"\t\t*****This IS THE ACCOUNT NUMBER: "<<num<<"*****"<<endl;
cout<<"Please enter the type of transaction you want(c-checking and s-savings)";
cin>>indent;
cout<<endl;
        switch(indent)
        {
        case 'c':
                {
                cout<<"Enter monthly amount ";
                cin>>moo;
                accoun[x].set(num,moo);
                check[x].set_ch();
                break;
                }
        case 's':
                {
                cout<<"Enter monthly amount ";
                cin>>moo;
                accoun[x].set(num,moo);
                saving[x].set_in();
                break;
                }
        default:
                {
                cout<<"*******you entered the wrong data********\n" ;
                }
        }
num++;
}
cout<<"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++";
for(int k=0;k<3;k++)
{
accoun[k].display();
saving[k].display_savings();
check[k].display_checking();
}
getch();
}

Dani AI

Generated

The console snippet posted by is incomplete and won’t convert to a GUI without some refactoring. Missing class definitions (Account, Savings, Checking), non‑portable console calls, fixed‑size arrays and hard‑coded account numbering all need addressing first. As suggested, get a standard, compiling console version in place before attempting a GUI. As and pointed out, an incremental approach and some basic GUI tutorial reading are far more productive than asking for a complete rewrite.

Separate business logic from presentation: make Account/Savings/Checking pure model classes with clear APIs (deposit, withdraw, applyInterest, serialize) and no direct console I/O. Store accounts in a dynamic container (e.g., std::vector) instead of fixed arrays. Keep validation and error reporting in the model so the GUI only needs to display results and messages. A minimal class skeleton to illustrate the idea:

class Account {
    int number;
    double balance;
public:
    Account(int num=0, double bal=0.0);
    void deposit(double amt);
    bool withdraw(double amt); // returns false on insufficient funds
    std::string summary() const;
    void saveToStream(std::ostream&);
    void loadFromStream(std::istream&);
};

Choose a GUI toolkit that fits the target environment (Qt or wxWidgets for cross‑platform; C++/CLI Windows Forms, MFC or native Win32 on Windows). Recommended workflow:

  1. Stabilize and unit‑test the console model.
  2. Create a minimal GUI form for selecting an account and entering an amount.
  3. Wire events so the GUI calls model methods and refreshes views.
  4. Add input validation, file persistence, and error handling.

Practical tips: test the model with a tiny console driver before adding UI; validate every user value in the GUI; avoid rewriting everything at once. When asking for targeted help later, include a small, compiling example and the chosen GUI framework so responders (and the community members mentioned above) can give precise guidance.

Recommended Answers

All 7 Replies

first off.. should be
#include <iostream>

second... don't use void main ()..

change to int main () {

and end with return 0;
}

#include <iostream>
...

int main (){
....
return 0;
}

>Here is the code if you can do it plz send me the coding
You want to give us a simple console mode program and have us write a complicated GUI interface for it because you're too lazy to do it yourself? Are you having difficulty because nobody is stupid enough to do this for you? Or are you having difficulty because you have no clue what you're doing?

You'll have better luck if you actually attempt to do it yourself, then ask for help and not handouts.

To my favourite moderator if you knew you were not going to be able to do it you could have just kept quiet and leave it to those who can and for your information i am doing the program and asking help from fellow C++ geniuses.So please next time just zip it

im pretty sure that no one will just write the program for you and if you are trying then post more code... im pretty sure that bit you posted wont accomplish what you are asking for

To my favourite moderator if you knew you were not going to be able to do it you could have just kept quiet and leave it to those who can and for your information i am doing the program and asking help from fellow C++ geniuses.So please next time just zip it

Oh boy. Now you have really blown it!

Fix your console code so it at least compiles, then get yourself over to winprog and start the GUI tuts. Then have a go at converting your working C++ console program into a GUI program,post your effort, and if you are still stuck and have heavily apologized for the attitude I might lend a hand.

... i am doing the program and asking help from fellow C++ geniuses.

:lol: From fellow C++ geniuses hey, well, there certainly are several hanging around here, but seeing as you even use void main(), I'm certain your not one of them :lol:

Don't know about you, but saying to someone with the knowledge and willingness to help anyone out who shows effort around here to zip it, now, I think that is really stupid don't you think ;)

>if you knew you were not going to be able to do it you could have just
>kept quiet and leave it to those who can
That trick never works. Why? Because we've all seen it umpteen times. Some bozo like you who doesn't know jack about programming wants something way out of his league. He then claims that the experts on the forum aren't capable of doing it with the hopes that they'll get all insulted and do it for him.


By the way, this thread is now locked.

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.