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
xeze [42]
3 years ago
5

Assume the existence of a BankAccount class. Define a derived class, SavingsAccount that contains two instance variables: the fi

rst a double, named interestRate, and the second an integer named interestType. The value of the interestType variable can be 1 for simple interest and 2 for compound interest. There is also a constructor that accepts two parameters: a double that is used to initialize the interestRate variable, and a string that you may assume will contain either "Simple", or "Compound", and which should be used to initialize the interestType variable appropriately. There should also be a pair of functions getInterestRate and getInterestType that return the values of the corresponding data members (as double and int respectively).
Computers and Technology
1 answer:
Fynjy0 [20]3 years ago
8 0

Answer:

Class SavingsAccount : public BankAccount

{

double interestRate;

int interestType;

public SavingsAccount(double interestRate, string interestType)

{

this.interestRate=interestRate;

if(interestType=="Simple")

this.interestType=1;

else if(interestType=="Compound")

this.interestType=2;

}

public double getInterestRate()

{

return this.interestRate;

}

public int getInterestType()

{

return this.interestType;

}

}

Explanation:

You might be interested in
You would like to enter a formula that subtracts the data in cell B4 from the total of cells B2 and B3. What should the formula
anastassius [24]

Answer:

=b2 b3-b4 or something close to that, I hope this helps ^^

Explanation:

6 0
3 years ago
What do I do if someone wants to be my friend, and I don’t know who the person is online?
prohojiy [21]
Tell someone you're close to, and see what advice they have. It's best to ignore the person until then.
8 0
2 years ago
Read 2 more answers
Mental state shift involves what?
Delvig [45]

Answer:

It involves a matter involving doubt, uncertainty, or difficulty that may be solved, problem ... getting into a frame of mind to be creative and solve problems.

Explanation:

Hope i am marked as brainliest answer

5 0
3 years ago
What does PRAM stand for?
Nana76 [90]
<span>PRAM- Phase-Change Random Access Memory</span>
7 0
3 years ago
Read 2 more answers
Which Boolean operator produces the result 1 only if both values are 1? Which Boolean operator produces the result 0 only if bot
lorasvet [3.4K]

Blank 1 is AND

Blank 2 is OR

5 0
3 years ago
Other questions:
  • Which of the following applications can be used as a data source for a Microsoft® Word® mail merge? A.Outlook Contacts B.Microso
    9·2 answers
  • When does the VB.NET programming environment start to operate?
    10·1 answer
  • How do you create a logo on Adobe illustrator
    8·1 answer
  • Which term means a device that converts one voltage to another?
    13·1 answer
  • Write HTML code for inserting an image "cricket.jpeg" in size 500 width and 400 height.
    12·1 answer
  • Which of the following is NOT a fall prevention system?
    12·2 answers
  • Facts and statistics collected together to be used for different purposes is
    14·1 answer
  • Put these events in the order in which they occurred,
    9·1 answer
  • What is a guardian node summary for theta staking tool
    9·1 answer
  • What is cloud computing?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!