Answer to Question #264755 in C++ for nkashy

Question #264755

You are tech-entrepreneur venturing into the field of Financial technology and is concerned about the lack financial savings culture among the youth. You have settled on an idea to come up with your own software that allows users to deposit cash for safe keeping and future planning. Whenever a user wants to withdraw money from their accounts, they can visit nearby cash ATM that your company has setup, and withdraw directly by first keying in usernames and passwords. They are also given the option of checking their balance and changing their password. In order to make cash deposits, you have settled on the role of an administrator who will be stationed near an ATM machine, and users will be approaching this administrator to help them make deposits to their accounts. The administrator will log in t using their admin usernames and passwords. They will then be given an option of making a cash deposit for normal users, create an account for new users and also be able to change their administrator passwords.


1
Expert's answer
2021-11-12T00:08:54-0500


#include <iostream>


using namespace std;
class ATM{
    private:
        int balance;
    
    public:
        ATM(){
            balance=0;
        }
        void deposit(int amount){
            balance=balance+amount;
        }
        void withdraw(int amount){
            balance=balance-amount;
        }
        void checkBalance(){
            cout<<"\nCurrent balance = "<<balance;
        }
    
};


int main()
{
    ATM t;
    t.checkBalance();
    t.deposit(5000);
    t.checkBalance();
    t.withdraw(1500);
    t.checkBalance();


    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS