Answer to Question #268236 in C++ for Sasuke

Question #268236

HBL Bank requires account management software. The branch manager met with the software engineers and


discussed the details/requirements. According to him, the bank needs to store account title (name), account


number, account type and balance for each account entry. You can deposit and withdraw amount. You are required


to provide a library that can be utilized in the management system.

1
Expert's answer
2021-11-18T15:21:53-0500


#include<iostream>
using namespace std;
class HBL{
	private:
		string	title;
		int account_number;
		string account_type;
		double balance;
	public:
		void input(){
			cout<<"Enter account title:  ";
			cin>>title;
			cout<<"Enter account number: ";
			cin>>account_number;
			cout<<"Enter account type:  ";
			cin>>account_type;
			cout<<"Enter account balance:   ";
			cin>>balance;
		}
		
		void deposit(double amount){
			cout<<"Amount deposited successfully\n: Your current balance is:  "<<balance + amount<<endl;
		}
		void withdraw(double amount){
			if(balance>amount){
				cout<<"Withdrawal successful: \n Your current balance is:  "<<balance-amount;
			}
			else{
				cout<<"Insufficient funds in your account  "<<endl;
			}
			
		}
};


int main(){
	HBL b;
	b.input();
	b.deposit(10000);
}

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