Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 1 (6 points Write a program called StaticBank.cpp that implements a function to track the current balance of a bank account. The user has
Problem 1 (6 points Write a program called StaticBank.cpp that implements a function to track the current balance of a bank account. The user has the option to deposit or withdraw money, but do not allow an overdraft of the account (negative balance). The program MUST contain the following features . The balance-tracking function must use a static local variable to store the balance. e User input must be handled in mainO o o o Ask for a transaction amount Update the balance via your balance-tracking function Ask whether the user has any more transactions A sample run of the program is shown below. CMPSC-121 Static Bank Enter transaction amount (+ for deposit,- for withdrawal): 145.00 Current Balance: $145.00 Do you have another transaction (Y/ N)? y CMPSC-121 Static Bank Enter transaction amount (+ for deposit,- for withdrawal): 25.00 Current Balance: $170.00 Do you have another transaction (Y/ N)? y CMPSC-121 Static Bank Enter transaction amount (+ for deposit' - for withdrawal): -30.00 Current Balance: $140.00 Do you have another transaction (Y/ N)? y CMPSC-121 Static Bank Enter transaction amount (+ for deposit' - for withdrawal): -150.00 Impermissible withdrawal, insufficient funds! Do you have another transaction (Y/ N)? y
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started