Find Jobs
Hire Freelancers

ATM C++ PROGRAM

$10-30 USD

Cancelled
Posted almost 10 years ago

$10-30 USD

Paid on delivery
write a C++ program that simulates an ATM. A c ustomer should be able to • deposit to the account, • withdraw from the account, and • print the current balance. The customer may choose to do these transactions in any order and as many times as he/she would like to. The program should end only when the user wants to quit. The details are as follows: • Deposit : The customer adds a certain am ount to the account balance. Your program must ask the customer how much to deposit. Notice that a customer cannot deposit a negative amount or 0 dollars. Your program must keep asking for the proper amount until the user enters one. Once the transaction i s complete, the current balance should be displayed. • Withdraw: The customer subtracts a certain amount from the account balance. Your program must ask the customer how much to withdraw. Note that a customer is not allowed to remove more than the current b alance or a negative amount. Your program must keep asking for the proper amount until the user enters one. Once the transaction is complete, the current balance should be displayed. • Get Current Balance: The customer's current balance is printed. Assume t hat the customer initially has $5000.00 in his/her account. • Menu Options: The user should enter the letter: • (D) or (d) to make a deposit, • (W) or (w) to make a withdrawal, • (B) or (b) to view the current balance, and • (Q) or (q) to quit. • If the user enters another letter, your program should present the user his/her options aga in and ask for a proper command. Functions: 1. You will write one function called print_menu() for displaying the following text and call it whenever necessary: “Here are your options: Enter (D) or (d) to make a deposit, (W) or (w) to make a withdrawal, (B) or (b) to view the current balance and (Q) or (q) to quit.” // Note that this function will consist of a cout command only. 2. You will write another function called print_balance() f or displaying the current balance and call it from the main() program whenever necessary. Here is an example of the running program: (The user responses are in red and bold.) Welcome! Your current balance is 5000.00 dollars. Here are your options: Ente r (D) or (d) to make a deposit, (W) or (w) to make a withdrawal, (B) or (b) to view the current balance and (Q) or (q) to quit. C Here are your options: Enter (D) or (d) to make a deposit, (W) or (w) to make a withdrawal, (B) or (b) to view the current balance and (Q) or (q) to quit. D Please enter the amount you'd like to deposit: 150.00 Your transaction is complete. Your current balance is 5150.00 dollars. Here are your options: Enter (D) or (d) to make a deposit, (W) or (w) to make a withdrawal, (B) o r (b) to view the current balance and (Q) or (q) to quit. d Please enter the amount you'd like to deposit: - 25.00 Please enter a proper amount: - 50.00 Please enter a proper amount: 50.00 Your transaction is complete. Your current balance is 5200.00 dollars . Here are your options: Enter (D) or (d) to make a deposit, (W) or (w) to make a withdrawal, (B) or (b) to view the current balance and (Q) or (q) to quit. W Please enter the amount you'd like to withdraw: - 100.00 Please enter a proper amount: 100.00 Your transaction is complete. Your current balance is 5100.00 dollars. Here are your options: Enter (D) or (d) to make a deposit, (W) or (w) to make a withdrawal, (B) or (b) to view the current balance and (Q) or (q) to quit. B Your current balance is 5100.00 dollars. Here are your options: Enter (D) or (d) to make a deposit, (W) or (w) to make a withdrawal, (B) or (b) to view the current balance and (Q) or (q) to quit. Q
Project ID: 5942832

About the project

Remote project
Active 10 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs

About the client

Flag of UNITED STATES
Cleveland, United States
5.0
4
Payment method verified
Member since May 14, 2014

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.