1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
LekaFEV [45]
3 years ago
14

There Are Two Programs in this Question who will attempt first i will give brainliest ans reward and big points:-

Computers and Technology
1 answer:
Korolek [52]3 years ago
4 0

Answer:

here you go ,could only do Question 2.try posting question 1 seperately maybe someone else can also try to help

Explanation:

Question 2.

#include <iostream>

using namespace std;

// class BankAccount

class BankAccount{

  

    // instance variables

    private:

        int accountID;

        int balance;

  

    public:

      

        // constructor

        BankAccount(int accountID, int balance){

            this->accountID = accountID;

            this->balance = balance;

        }

      

        // getters and setters

        void setAccoutnId(int accountID){

            this->accountID = accountID;

        }

      

        int getAccountId(){

            return accountID;

        }

      

        void setBalance(int balance){

            this->balance = balance;

        }

      

        int balanceInquiry(){

            return balance;

        }

};

class CurrentAccount : public BankAccount{

  

    public:

  

        // constructor

        CurrentAccount(int accountID, int balance):BankAccount(accountID,balance){

          

        }

      

        // function amount to withdraw

        void amountWithdrawn(int amount){

            setBalance(balanceInquiry()-amount);

        }

      

        // function to deposit amount

        void amountDeposit(int amount){

            setBalance(balanceInquiry()+amount);

        }

};

class SavingsAccount : public BankAccount{

  

    public:

      

        // constructor

        SavingsAccount(int accountID, int balance):BankAccount(accountID,balance){

          

        }

  

        // function amount to withdraw

        void amountWithdrawn(int amount){

            setBalance(balanceInquiry()-amount);

        }

      

         // function to deposit amount

        void amountDeposit(int amount){

            setBalance(balanceInquiry()+amount);

        }

      

      

};

int main()

{

    // calling function of Current Account

    cout<<"Current Account : "<<endl;

    CurrentAccount current(122,100000);

    current.amountWithdrawn(10000);

    cout<<"Your balance after withdraw : ";

    cout<<current.balanceInquiry()<<endl;

    current.amountDeposit(30000);

    cout<<"Your balance after deposit : ";

    cout<<current.balanceInquiry()<<endl;

    cout<<endl<<endl;

  

    // calling function of Savings Account

    cout<<"Savings Account : "<<endl;

    SavingsAccount saving(125,80000);

    saving.amountWithdrawn(5000);

    cout<<"Your balance after withdraw : ";

    cout<<saving.balanceInquiry()<<endl;

    saving.amountDeposit(20000);

    cout<<"Your balance after deposit : ";

    cout<<saving.balanceInquiry();

    return 0;

}

You might be interested in
A diet to contain at least 2400 units of vitamins, 1800 units of minerals, and 1200 calories two foods , Food A and Food B are t
Firdavs [7]

Answer:

30 units of Food A and 45 units of Food B are to be purchased to keep costs at the minimum $105.

Explanation:

X = Amount of food A

Y = Amount of food B

Z= 2X+Y..... minimum cost equation

50X + 20Y > 2400 .................Vitamins .......(1)

30X + 20Y > 1800 ...................Minerals.......(2)

10X + 40Y > 1200 .................Calories ..........(3)

X  > 0

y  > 0

X=30  and Y = 45

Z= 2(30) + 45 = $105

8 0
3 years ago
There are four ways to create a macro? FALSE OR TRUE
Murljashka [212]

Answer: True

Explanation:

There are actually four ways to create a macro. You would want to use %let.

7 0
2 years ago
Read 2 more answers
Upload your completed chart using the information you gained in your interviews.
mars1129 [50]

Just so you know this isn't how this works. You have to give people a question and answers to choose from.

3 0
3 years ago
Why was chess considered to be one of the most difficult games for computers to play well?​
telo118 [61]

Answer:

In a general sense, the answer to that is Go. The main reason for that is because the size of the board and the fact that it is empty to begin with gives the game a much more complex opening to the game. But if you were to make things equal in board size then chess is the obvious more difficult game to master.

Explanation:

6 0
2 years ago
Read 2 more answers
Which action is legal for pwc operators traveling at greater than "slow, no wake speed"?
brilliants [131]
When operating a PWC at greater than “slow, no wake speed,” you must:

<span><span>1. Stay at least 200 feet from any Great Lakes shoreline.
</span>2. Not cross within 150 feet behind another vessel other than another PWC.

</span>According to this law, an<span>yone </span>will<span> operate </span>a ship<span> with an engine of maximum sixty horsepower</span><span>. However, </span>someone below<span> age </span>twelve could<span> operate </span>a ship<span> with </span>someone aboard a minimum of sixteen<span> years </span>getting on<span> if the engine </span>doesn't<span> exceed </span>thirty-five horsepower unit<span>. From ages </span>twelve to fifteen<span>, </span>someone will<span> exceed the lower </span>ordinance<span> with a </span>seafaring<span> safety certificate on board or </span>someone sixteen<span> or older. At 16, </span>someone will<span> operate </span>a ship<span> of any legal speed </span>while not superintendence<span>.</span>
7 0
3 years ago
Read 2 more answers
Other questions:
  • What color typically indicates the speaker port on a sound card?
    10·2 answers
  • Suppose that Alice wants to send Bob a 50 kilobyte message over a 1 Gbps link. The total time required to transmit the message (
    5·1 answer
  • By default, PowerPoint ends a slide show with a black slide. <br> a. True<br> b. False
    5·2 answers
  • Consider the following class declaration: public class Square { private double sideLength; public double getArea() { return side
    13·1 answer
  • PLEASE HURRY 30 POINTS
    15·2 answers
  • Does anyone know who this man issss?
    13·1 answer
  • What is the difference between a general ai as opposed to a specialized ai?.
    6·1 answer
  • 10) ________ objects control the flow of the application. A) Boundary B) Utility C) Control D) All of the above
    11·1 answer
  • 100 POINTS FOR ANYONE WHO CAN DO THIS!
    15·1 answer
  • Which option identifies the programming paradigm selected in thr following scenario? A student is writing a science fiction stor
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!