-
Notifications
You must be signed in to change notification settings - Fork 0
/
Bank App1.cpp
29 lines (25 loc) · 1022 Bytes
/
Bank App1.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* Simple bank app in C++ */
#include <iostream>
int main(int argc, char *argv[]) {
double accountBalance =0.0;
double depositAmount =0.0;
bool userFinished = false;
char userFinishedChoice;
while(!userFinished) {
std::cout << "Welcome to Big Booty Bank." << std::endl;
std::cout << "Your current balance is: $" << accountBalance << std::endl;
std::cout << "Enter the amount you want to deposit: $";
/* Read in next input from user */
std::cin >> depositAmount;
/* Update the account balance */
accountBalance += depositAmount;
std::cout << "Your new balance is: $" << accountBalance << std::endl;
std::cout << "Are you done yet? Y/N: ";
std::cin >> userFinishedChoice;
if (userFinishedChoice == 'Y' || userFinishedChoice == 'y') {
userFinished = true;
}
}
std::cout << "Thanks for using Big Booty Bank. Real chill of you fam. Aight, I'm out. Peace!" << std::endl;
return 0;
}