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
liubo4ka [24]
4 years ago
10

Create a SavingsAccount class. Use a static data member annualInterestRate to store the annual interest rate for each of the sav

ers. Each member of the class contains a private data member savingsBalance indicating the amount the saver currently has on deposit. Provide member function calculateMonthlyInterest that calculates the monthly interest by multiplying the savingsBalance by annualInterestRate divided by 12; this interest should be added to savingsBalance. Provide a static member function modifyInterestRate that sets the static annualInterestRate to a new value. Write a main program to test your class. Your program should prompt the user to enter the savingsBalance for two different accounts. It should ask for the annualInterestRate.
Computers and Technology
1 answer:
andrew-mc [135]4 years ago
4 0

Answer:

see explaination

Explanation:

SavingsAccount.h

#pragma once

#ifndef SAVINGS_H

#define SAVINGS_H

//SavingsAccount class declaration

class SavingsAccount

{

//declare data members

private:

//set annualInterestRate to 0.0 default value

static double annualInterestRate;

double savingsBalance;

public:

//set the balance

void setBalance(double);

//modify interest rates

static void modifyInterestRate(double);

//retruns total balance with interest

double calculateMonthInt();

};

#endif

SavingsAccount.cpp

//include required header files

#include<iostream>

#include"SavingsAccount.h"

using namespace std;

//set the annualInterestRate to 0

double SavingsAccount::annualInterestRate = 0;

//static funtion modify interest rate

void SavingsAccount::modifyInterestRate(double iRate)

{

annualInterestRate = iRate;

}

//set the balance

void SavingsAccount::setBalance(double bal)

{

savingsBalance = bal;

}

//calculating savings balance with monthly interest

double SavingsAccount::calculateMonthInt()

{

double monthInt = 0;

monthInt += savingsBalance*annualInterestRate / 12;

return savingsBalance += monthInt;

}

DriverProgram.cpp

//include required header files

#include<iostream>

#include "SavingsAccount.h"

using namespace std;

//main methods

int main()

{

//delcare class objects

SavingsAccount saver1, saver2;

//setter functions of balance

saver1.setBalance(2000.00);

saver2.setBalance(3000.00);

//Setting annual interset 0.03 to static variable

saver1.modifyInterestRate(0.03);

//finding the balance in saver1 and saver2 account

cout << "Balance of saver1 and saver2 on 3% interest Rate\n";

cout << "--------------------------------------------------\n";

cout << "Balance of saver1 = " << saver1.calculateMonthInt()

<< endl;

cout << "Balance of saver2 = " << saver2.calculateMonthInt()

<< endl << endl;

//Setting annual interset 0.04 to static variable

saver1.modifyInterestRate(0.04);

cout << "Balance of saver1 and saver2 on 4% interest Rate\n";

cout << "---------------------------------------------------\n";

cout << "New Balance of saver1 = " << saver1.calculateMonthInt() << endl;

cout << "New Balance of saver2 = " << saver2.calculateMonthInt() << endl<<endl;

return 0;

}

You might be interested in
An Excel formula always begins with a(n) ____.
Basile [38]
Every Excel formula begins with '=' (equality) sign.
7 0
3 years ago
Icons for the most commonly used applications on a Mac can be found here. Dock Menu bar Toolbar Toolbox
Kazeer [188]

What do you mean please reply to this comment with a question.

4 0
4 years ago
Read 2 more answers
Because of the abundance of water on planet Earth, hydrogen gas (H2) is a candidate in the search for a replacement for petroleu
Dennis_Churaev [7]

The reason why plants are considered to be one step ahead in the utilization of hydrogen as an alternative fuel source is because; Plant cells possess water-splitting enzymes

<h3>What are splitting Enzymes?</h3>

Splitting Enzyme’s are like aldolases that catalyze the conversion of a molecule into two smaller molecules without the addition or removal of any atoms.

Now in plant biology, plants make use of he light-driven water-splitting/oxygen-evolving enzyme known as Photosystem II in photosynthesis to split water.

Read more about splitting enzymes at; brainly.com/question/14713715

3 0
2 years ago
What is an example of value created through the use of deep learning?
vichka [17]

An example of value which is created through the use of deep learning is: b. reducing multi-language communication friction in a company through automatic language translation.

<h3>What is machine learning?</h3>

Machine learning (ML) is also known as deep learning or artificial intelligence (AI) and it can be defined as a subfield in computer science which typically focuses on the use of computer algorithms, data-driven techniques (methods) and technologies to develop a smart computer-controlled robot that has the ability to automatically perform and manage tasks that are exclusively meant for humans or solved by using human intelligence.

In Machine learning (ML), data-driven techniques (methods) can be used to learn source ranges directly from observed multi-language communication.

In this context, we can infer and logically deduce that an example of value which is created through the use of deep learning is reducing multi-language communication friction that exist among employees working in a company through automatic language translation.

Read more on machine learning here: brainly.com/question/25523571

#SPJ1

8 0
2 years ago
Design an Application called Student Course Management create interface called Student Course add an abstract method called ad C
sdas [7]

Answer:

Im pretty sure this has to do with coding, and running an application, so, you should probably run something like MSWord

Explanation:

6 0
3 years ago
Other questions:
  • Sarah has to pick images that display camera care. Which images would she pick to show camera care?
    11·1 answer
  • A restaurant bill comes to $28.35. Find the total cost if the tax is 6.25% and a 20% tip is left on the amount before tax.​
    6·1 answer
  • How has the internet of things impacted buisness?
    15·1 answer
  • A major ozone depletion happened in the 1900s. What was it caused by
    10·2 answers
  • Which command on the page layout ribbon enables a user to mark where a new page will begin on the printed copy?
    6·1 answer
  • In the water cycle,lake water will do which of the following first
    8·1 answer
  • If classes C1 and C2 both implement an interface Cint, which has a method whichIsIt, and if C1 c = new C1( ); is performed at on
    15·1 answer
  • 2. When a process is "listed" in a queue, what information is actually stored in the list in memory?
    14·1 answer
  • (25 POINTS) Some applications work on all devices while others work on some devices. True or False?
    13·1 answer
  • A is a program for editing,rearranging and storing text
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!