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
What type of document is a mobile device's EULA?
MakcuM [25]
EULA stands for End User License Agreement. This document is the contract between the software application author or publisher and the user of that application. It is also called "software license", because it establishes the purchaser's right to use the software on the mobile device. T<span>he user agrees to pay for the privilege of using the software, and promises the software author or publisher to comply with all restrictions stated in the EULA. </span>
6 0
3 years ago
Ben chang noticed that his store was lagging in sales . He realized that his staff was not experienced enough . As the store man
dem82 [27]
Ben should set up a program to teach his staff about customer service, and communicating with clients. 
4 0
2 years ago
Read 2 more answers
Help to how to write pseudo code to insert a new node to Binary Search Tree. Using C++.
dimulka [17.4K]

Answer:

Let the function be Node* ins(Node *root,int k)

if root node is NULL then return new node with data equal to k.

If the k <root->data

root->left=ins(root->left,k);

else if k >root->data

root->right =ins(root->right,k);

At last return root.

Explanation:

Node is always inserted at the at the leaf node.We will search k in the tree if we hit a the leaf node the new node is inserted as the child of the leaf node.

4 0
2 years ago
The Windows Net use command is a quick way to discover any shared resources on a computer or server. True or False
V125BC [204]
Yes it’s true the window net use command is a quick way to discover any shared resources on a computer or server
8 0
2 years ago
Basic python coding, What is the output of this program? Assume the user enters 2, 5, and 10.
r-ruslan [8.4K]

Answer:

17.0

Explanation:

after first loop numA = 0.0 + 2 = 2.0

after second loop numA = 2.0 + 5 = 7.0

after third loop numA = 7 + 10 = 17.0

8 0
3 years ago
Other questions:
  • You are given a data set with information from 1,000 high school students (of which the following is a part of the data) and ask
    6·1 answer
  • Please draw a diagram of a complete graph with 5 vertices (K5), its adjacency matrix and adjacency list representations.
    5·1 answer
  • program students can get credit for their high school classes as long as they take a specific courses that a college will accept
    13·2 answers
  • What does the internet engineering task force (IEFT) do?
    5·1 answer
  • What two pieces of information would you need in order to measure the masses of stars in an eclipsing binary system?
    9·1 answer
  • Consider an array inarr containing atleast two non-zero unique positive integers. Identify and print, outnum, the number of uniq
    10·1 answer
  • Jimmy has been issued a citation for littering in a city park. When Jimmy
    8·1 answer
  • Write a recursive function that returns 1 if an array of size n is in sorted order and 0 otherwise. Note: If array a stores 3, 6
    13·1 answer
  • How does computer applications affect our lives daily? 1- paragraph (4 sentences)
    8·2 answers
  • True or False? Security code is almost always open source!<br> True<br> False
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!