subject

Design a SavingsAccount class that stores a savings account’s annual interest rate and balance. The class constructor should accept the amount of the savings account’s starting balance. The class should also have methods for subtracting the amount of a withdrawal, adding the amount of a deposit, and adding the amount of monthly interest to the balance. The monthly interest rate is the annual interest rate divided by twelve. To add the monthly interest to the balance, multiply the monthly interest rate by the balance, and add the result to the balance. Test the class in a program that calculates the balance of a savings account at the end of a period of time. It should ask the user for the annual interest rate, the starting balance, and the number of months that have passed since the account was established. A loop should then iterate once for every month, performing the following: a. Ask the user for the amount deposited into the account during the month. Use the class method to add this amount to the account balance. b. Ask the user for the amount withdrawn from the account during the month. Use the class method to subtract this amount from the account balance. c. Use the class method to calculate the monthly interest. After the last iteration, the program should display the ending balance, the total amount of deposits, the total amount of withdrawals, and the total interest earned.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 18:20, germaniranda619
Write a javascript program that reads three integers named start, end, and divisor from three text fields. your program must output to a div all the integers between start and end, inclusive, that are evenly divisible by divisor. the output integers must be separated by spaces. for example, if a user entered 17, 30, and 5, your program would output "20 25 30" (without the quotes) because those are the only integers between 17 and 30 (including 17 and 30) that are evenly divisible by 5.
Answers: 2
image
Computers and Technology, 22.06.2019 14:00, michelle7511
Which database model is best used for data warehouse and data mining
Answers: 3
image
Computers and Technology, 23.06.2019 14:00, camiserjai1832
In which job role will you be creating e-papers, newsletters and preiodicals
Answers: 1
image
Computers and Technology, 23.06.2019 15:00, hunteryolanda82
Based on the current economic situation do you expect the employment demand for graduating engineers to increase or decrease? explain the basis for your answer. with a significant economic recovery, what do you think will happen to future enrollments in graduating engineering programs?
Answers: 1
You know the right answer?
Design a SavingsAccount class that stores a savings account’s annual interest rate and balance. The...

Questions in other subjects:

Konu
Mathematics, 25.05.2021 09:30
Konu
Chemistry, 25.05.2021 09:30
Konu
Mathematics, 25.05.2021 09:30
Konu
Mathematics, 25.05.2021 09:30