subject
Engineering, 26.11.2019 02:31 Camill0310

Create a class named accountsavings. this class has a static double variable which stores the annual interest rate for all account holders. the name of variable is annualinterestrate. the class also has another double variable named savingsbalance which stores balance for current account. a. write a constructor to create an account with specified balance. add a validation whether the balance is greater than 0.0. if it is less than 0.0 then throw an exception. b. write a non-static calculatemonthlyinterest method to calculate the monthly interest by multiplying the savingsbalance by annualinterestrate divided by 12 – the interest should be added to savingsbalance. c. write a static method named modifyinterestrate to set the annual interest rate. add a validation whether the rate is greater than equal to 0.0 and less than or equal 1.0. otherwise, throw an exception. d. write a tostring method which returns savingsbalance in a string format. after that, create accountsavingstest class. create two objects from the class accountsavings with balances $2000.00 and $3000.00. then, set the interest rate to 4%, then calculate the monthly interest rate for each 12 months for each object and print the new balances with tostring method for each object. upload accountsavings. java and accountsavingstest. java.

ansver
Answers: 3

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Burgers vector is generally parallel to the dislocation line. a)-true b)-false
Answers: 2
question
Engineering, 04.07.2019 18:20
For a gate width of 2 m into the paper, determine the force required to hold the gate abc at its location.
Answers: 1
question
Engineering, 04.07.2019 19:10
What is creep? what is stress relaxation?
Answers: 1
question
Engineering, 04.07.2019 19:20
The power source in a certain welding setup generates 3500w that is transferred to the low carbon steel work with a heat transfer factor of 0.85. the melting factor in the operation is 0.45. a continuous fillet weld is to be made with a cross-sectional area of 23 mm2 determine the travel speed at which the welding can be accomplished.
Answers: 3
You know the right answer?
Create a class named accountsavings. this class has a static double variable which stores the annual...
Questions
question
Social Studies, 01.12.2021 19:40
question
Physics, 01.12.2021 19:40
question
Mathematics, 01.12.2021 19:40
question
Mathematics, 01.12.2021 19:40
question
History, 01.12.2021 19:40
Questions on the website: 13722367