I need to convert this:
Code:#include <iostream> using namespace std; //Displays current balance void menu1(float balance){ cout << "Your current balance is: "<<balance<<endl; system ("PAUSE"); } //deposit void menu2(float balance){ float numb = 0; cout << "How much would you like to deposit today: "; cin >> numb; float dtotal = balance + numb; cout << "you current balance is: "<<dtotal<<endl; system ("PAUSE"); } //withdraw void menu3(float balance){ float withdraw = 0; cout << "How much would you like to withdraw today: "; cin >> withdraw; float wtotal = balance - withdraw; cout << "you current balance is: "<<wtotal<<endl; system ("PAUSE"); } void main() { int menu; int triger = 0; int balance = 2000; while(triger==0){ cout << "1. Get a balance inquiry." << endl; cout << "2. Make a deposit." << endl; cout << "3. Make a withdrawal." << endl; cout << "4. Exit." << endl; cout << "what would you like to do?:"; cin >> menu; switch (menu){ case 1: //Current balance menu1(balance); break; case 2://does the deposit menu2(balance); break; case 3://does the withdrawal menu3(balance); break; default:// exit out the loop cout << "Thank you, have a nice day" << endl; system ("PAUSE"); triger=1; } system ("cls"); } }
Into a class style. What is the easiest way?
XI Wiki

