create account

6.12. (Part 2) SavingsAccount Class - Java by kakradetome

View this thread on: hive.blogpeakd.comecency.com
· @kakradetome ·
$6.34
6.12. (Part 2) SavingsAccount Class - Java
https://www.youtube.com/watch?v=uyVY5axsmOo

Starting out with Java: From control structures through objects
Chapter 6
Programming Challenges

12. SavingsAccount Class

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.

Gaddis, Tony (2015-05-29). Starting Out with Java: From Control Structures through Objects (Page 400 and 401). Pearson Education. Kindle Edition.

Happy Steeming Everyone! :)
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
👎  
properties (23)
authorkakradetome
permlink6-12-part-2-savingsaccount-class-java
categoryprogramming
json_metadata{"tags":["programming","coding","java","savings-account","tony-gaddis"],"image":["https://img.youtube.com/vi/uyVY5axsmOo/0.jpg"],"links":["https://www.youtube.com/watch?v=uyVY5axsmOo"],"app":"steemit/0.1","format":"markdown"}
created2017-01-28 03:01:54
last_update2017-01-28 03:01:54
depth0
children1
last_payout2017-02-28 13:51:03
cashout_time1969-12-31 23:59:59
total_payout_value4.794 HBD
curator_payout_value1.545 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,761
author_reputation31,794,084,266,065
root_title"6.12. (Part 2) SavingsAccount Class - Java"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id2,362,089
net_rshares27,515,501,458,834
author_curate_reward""
vote details (38)
@cheetah ·
Hi! I am a robot. I just upvoted you! I found similar content that readers might be interested in:
http://stackoverflow.com/questions/26569295/savings-account-class-how-to-turn-in
👍  
properties (23)
authorcheetah
permlinkcheetah-re-6-12-part-2-savingsaccount-class-java
categoryprogramming
json_metadata""
created2017-01-28 03:02:21
last_update2017-01-28 03:02:21
depth1
children0
last_payout2017-02-28 13:51:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length179
author_reputation942,693,160,055,713
root_title"6.12. (Part 2) SavingsAccount Class - Java"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id2,362,091
net_rshares20,170,495,974
author_curate_reward""
vote details (1)