Write a program that establishes two savings accounts

Assignment Help JAVA Programming
Reference no: EM13756619

Overall Requirements

Write a program that establishes two savings accounts with saver1 having account number 10002 with an initial balance of $2,000, and saver2 having account 10003 with an initial balance of $3,000. Set a common rate of interest at 5% per year. At the end of each month, update the balance by adding one month's interest to the balance, so that the balance compounds monthly. Print an output that displays the month number and the account number and the balance for each of the two accounts. Use month 0 to display the initial balances, month 1 to display the balances after the first month's interest, and so on. At the end of the year, display the total balance for both accounts combined, like this:

Output:

Monthly balances for one year with 0.05 annual interest:

Month Account # Balance Account # Balance

----- --------- ------- --------- -------

0 10002 2000.00 10003 3000.00

1 10002 2008.33 10003 3012.50

2 10002 2016.70 10003 3025.05

3 10002 2025.10 10003 3037.66

4 10002 2033.54 10003 3050.31

5 10002 2042.02 10003 3063.02

6 10002 2050.52 10003 3075.79

7 10002 2059.07 10003 3088.60

8 10002 2067.65 10003 3101.47

9 10002 2076.26 10003 3114.39

10 10002 2084.91 10003 3127.37

11 10002 2093.60 10003 3140.40

12 10002 2102.32 10003 3153.49

Final balance of both accounts combined: 5255.81

Use two classes, a SavingsAccount class and a YourNameProg4 as your Driver class.

SavingsAccount.java class

In the SavingsAccount class, declare a class variable called annualInterestRate, an instance constant called ACCOUNT_NUMBER, and an instance variable called balance. Provide a two-parameter constructor to initialize the instance constant and instance variable, and provide accessors for the instance constant and instance variable. Provide an addMonthlyInterest method to update the balance, by adding (balance * annualInterestRate / 12) to the current balance.

You are also required to provide a class method that sets the annual interest rate.

YourNameProg4.java class

In the YourNameProg4 Driver class, instantiate the saver1 and saver2 objects. Set the annual interest rate at 0.05. Print the table heading lines. Use a for loop to print the initial account numbers and balances and the account numbers and balances each month after that month's interest has been added. After the last month's printout, compute and display the total of both balances.

Your driver should generate the following outputs:

Output:

Monthly balances for one year with 0.05 annual interest:

Month Account # Balance Account # Balance

----- --------- ------- --------- -------

0 10002 2000.00 10003 3000.00

1 10002 2008.33 10003 3012.50

2 10002 2016.70 10003 3025.05

3 10002 2025.10 10003 3037.66

4 10002 2033.54 10003 3050.31

5 10002 2042.02 10003 3063.02

6 10002 2050.52 10003 3075.79

7 10002 2059.07 10003 3088.60

8 10002 2067.65 10003 3101.47

9 10002 2076.26 10003 3114.39

10 10002 2084.91 10003 3127.37

11 10002 2093.60 10003 3140.40

12 10002 2102.32 10003 3153.49

Final balance of both accounts combined: 5255.81

Reference no: EM13756619

Questions Cloud

Excellent product and excellent location : Charles Lucky operates a bakery in Idaho Falls, Idaho. Because of its excellent product and excellent location, demand has increased by 35% in the last year. On far to many occasions, customers have not been able to purchase the bread of their choice..
Reason behind the predominance of new ventures : What is the reason behind the predominance of new ventures in the United States (U.S.) economy? What effect has this had on the U.S. economy?
What operations strategy could dell be attempting : Dell has recently switched from allowing customers a great deal of flexibility in designing their own computers to having a few standard models with few options that can be selected by the customer. Based on this information, respond to the following..
Organizing a dinner-dance concert for a local charity : You are in charge of organizing a dinner-dance concert for a local charity. You have reserved a hall that will seat 30 couples and have hired a jazz combo. Develop a scope statement for this project that contains examples of all of the elements. Assu..
Write a program that establishes two savings accounts : Write a program that establishes two savings accounts with saver1 having account number 10002 with an initial balance of $2,000, and saver2 having account 10003 with an initial balance of $3,000
Organizing a dinner-dance concert for a local charity : You are in charge of organizing a dinner-dance concert for a local charity. You have reserved a hall that will seat 30 couples and have hired a jazz combo. Develop a scope statement for this project that contains examples of all of the elements. Assu..
Determine the expected value of perfect information : Place-Plus, a real estate development firm is considering several alternative development projects. These include building and leasing an office park, purchasing a parcel of land and building an office building to rent, buying and leasing a warehouse..
Workplace violence is likely to occur : Workplace violence is likely to occur in ________
Discuss a circored project failure : From a project management approach, identify and discuss a Circored Project failure and what could have been done to avoid it. Imagine you were the project manager. Describe how you would communicate to the project team the use of project buffers

Reviews

Write a Review

JAVA Programming Questions & Answers

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

  What is the greatest common divisor

What is the greatest common divisor of the Fibonacci numbers f100 and f101 by Euclid algorithm.

  Calculate the body mass index

Write an application (BMICalc) that reads the user's weight in poinds and height in inches, then calculates the Body Mass Index.

  Write java program to read in sequence of hourly temperature

Write down Java program which reads in sequence of hourly temperature readings over 24-hour period using arrays. Your program must find and show maximum and minimum temperatures.

  Implement a fishlake simulation similar to the previous

implement a fishlake simulation similar to the previous assignment. you will then make adjustments to accommodate class

  1 create a recursive factorial program that prompts the

1. create a recursive factorial program that prompts the user for an integer n and writes out a series of equations

  Initialized the array of words by an assignment statement.

modify the following program . The program from Lab 4 initialized the array of words by an assignment statement.

  Implement a javascript program for the validation case

Write a JavaScript program for the validation case using the RegExp method - implement a JavaScript program for the validation case

  Write a short java method to count the number of nodes

Write a short Java method to count the number of nodes in a circularly link list.

  Redesign the grading program as an object-oriented design

redesign the grading program as an object-oriented design. We will start with a simple Student class. The student will have a name, an id (as a String) and a set of grades (as doubles)

  Write java program to find calories-conditional operator

Write down the answer for this program? Write down Java program (use Conditional (? Operator) which suggests number of calories a person must eat each day.

  Program to maintain list of names with associated numbers

Write a complete subclass of SimpleList named ListSet where the ‘add' method is overridden such that a ListSet will never contain duplicate items - Write a program to maintain a list of names with associated telephone numbers.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd