The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 399 Weeks Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
#include <iostream>
Â
using namespace std;
Â
class Bank_Transaction
{
public:
     Bank_Transaction( ); //default constructor
     Bank_Transaction(double);
     double Check_Balance( );
     void Deposit(double);
     void Withdrawal(double);
private:
     double balance;
};
Â
Â
Bank_Transaction::Bank_Transaction()
{
     balance = 0;
}
Â
Bank_Transaction::Bank_Transaction(double amount)
{
Â
     balance = amount;
}
Â
Â
double Bank_Transaction::Check_Balance()
{
     return balance;
}
Â
void Bank_Transaction::Deposit(double amount)
{
     balance = balance + amount;
}
Â
void Bank_Transaction::Withdrawal(double amount)
{
     balance = balance - amount;
}
Â
int main()
{
     Bank_Transaction my_Acct;
     Bank_Transaction your_Acct(10340.85);
Â
     cout<<"Your Account Balance = "<<your_Acct.Check_Balance()<<endl;
     your_Acct.Deposit(512.30);
     cout<<"Your Account Balance = "<<your_Acct.Check_Balance()<<endl;
     your_Acct.Withdrawal(8284.56);
     cout<<"Your Account Balance = "<<your_Acct.Check_Balance()<<endl;
Â
Â
     cout<<"My Account Balance = "<<my_Acct.Check_Balance()<<endl;
     my_Acct.Deposit(2516.83);
     cout<<"My Account Balance = "<<my_Acct.Check_Balance()<<endl;
     my_Acct.Withdrawal(25.96);
     cout<<"My Account Balance = "<<my_Acct.Check_Balance()<<endl;
Â
     return 0;
}
Â
Question 1:Write the statement(ie. the actual line of code) in the program in Step 2 that initializes the balance of the object A????1your_AcctA????1.
Â
Â
Â
Question 2:Give the full name of the function(This is also referred to as the function header) and state the type of the constructor that initialized the object A????1your_AcctA????1.
Â
Â
Â
Â
Question 3:What happens if you add the statement A????1my_Acct.Balance = 0;A????1 to the main function of the program in Step 2 after the object declarations? Explain your answer.
Â
Â
Â
           Question 12:   What do we mean when we use the following phases?
                                   a. Inside the class
                                 b. Outside the class
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------sol-----------uti-----------on.-----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- ca-----------tch-----------