Run Code
|
API
|
Code Wall
|
Users
|
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
Please
log in
to post a comment.
<string> Indirect include of <errno.h> with gcc
Articulation Point
reverseKNode
Synchro#3
-Wall -std=c++14 -O0 -o a.out source_file.cpp
20201123
ThreadContext
BridgeEdge
AVL - ith element
ApelRefVal
Please log in to post a comment.