Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
005#
#include <cstdio> #include <cstdlib> #include <iostream> using namespace std; int newMoney; int currentMoney; int chose; class BankAccount { public: int deposit(int newMoney, int currentMoney){ return newMoney + currentMoney; } public: int withDrawal (int newMoney, int currentMoney){ return newMoney - currentMoney; } public: string askingChose (){ cout << "Press 1: to deposit money.\nPress 2: to withdrawal money.\n"; } }; int main () { BankAccount accountObject; accountObject.askingChose(); if (chose == 1) { cout << "Enter deposit amount: "<< endl; cin >> newMoney; } else { if (chose == 2) { cout << "Enter withDrawal amount: " <<endl; cin >> chose; } esle { cout << "You must enter a valid chose between 1 and 2"<< endl; } } return 0; }
run
|
edit
|
history
|
help
0
A string-integer comparison trick
Próba
queue
HalumResto
Test 8(2010)
Bin Tree playground
Lazy String Tokenizer Class
LP(Multi)
VecScalMultiOpLaod
grid