Use the code provided to you to do the following: 1) Write code that implements the function withdrawal. 2) Deposit 1000 into checking account. 3) Deposit 500 into saving account. 4) Withdraw 100 from checking account. 5) Get balance for both checking and saving account and display the amounts. #include usingnamespace std; class BankAccount{ private: float balance; public: BankAccount(); void Deposit(float); void WithDrawal(float); float getbalance(); };

EBK JAVA PROGRAMMING
8th Edition
ISBN:9781305480537
Author:FARRELL
Publisher:FARRELL
Chapter4: More Object Concepts
Section: Chapter Questions
Problem 2RQ
icon
Related questions
Question

Use the code provided to you to do the following:

1) Write code that implements the function withdrawal.

2) Deposit 1000 into checking account.

3) Deposit 500 into saving account.

4) Withdraw 100 from checking account.

5) Get balance for both checking and saving account and display the amounts.

#include <iostream>

usingnamespace std;

class BankAccount{

private: float balance;

public:

BankAccount();

void Deposit(float);

void WithDrawal(float);

float getbalance();

};

 

 

 

 

BankAccount::BankAccount()
balance - e;
float BankAccount::getBalance()
return balance;
void BankAccount::Deposit(float dep)
{
balance - balance • deps
int main()
BankAccount checking
BankAccount savings;
cout « "Checking balance is: " « checking.getBalance() <« endl;
cout « "Savings balance is: " « savings.getBalance() « endl;
checking. Deposit(100);
savings.Deposit(500);
I
Transcribed Image Text:BankAccount::BankAccount() balance - e; float BankAccount::getBalance() return balance; void BankAccount::Deposit(float dep) { balance - balance • deps int main() BankAccount checking BankAccount savings; cout « "Checking balance is: " « checking.getBalance() <« endl; cout « "Savings balance is: " « savings.getBalance() « endl; checking. Deposit(100); savings.Deposit(500); I
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT