Question: How can I alter the code to show me a list of all the deposits I input into case 1? #include #include using namespace std;
How can I alter the code to show me a list of all the deposits I input into case 1?
#include
using namespace std;
int Deposit (int amount, int currentBalance); int Withdrawal (int amount, int currentBalance); void viewBalance (int currentBalance);
int main(int argc, char** argv) { //variables int currentBalance = 1000; // beginning balance for checking account int amount = 0; int answer = 0; bool notComplete = true; while (notComplete){ cout << "--Would you like to make a withdrawal, deposit or a view of balance-- "; cout << "Submit 1 for Deposit / 2 for withdrawal / 3 for view balance / 4 for end of session "; cin >> answer; switch (answer) {
case 1: cout << "Enter the deposit amount" <
int Deposit (int amount, int currentBalance) { currentBalance +=amount; return currentBalance; }//end deposit
int Withdrawal(int amount, int currentBalance) { currentBalance -= amount; return currentBalance; }// end withdrawal
void viewBalance (int currentBalance)
{ cout <<" Your current balance is: " <
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
