You will be designing and creating a program that calculates simple and compound interest. Simple interest means that interest is only applied to the original amount. For instance, if a person deposits $1000 at 10% annual interest, then after one year they would have $1100 (the original $1000 plus the $100 interest) and after two years they would have $1200 (the original $1000, plus the $100 earned the first year, plus the $100 earned the second year).

With compound interest, the interest is applied to all money earned. So, starting with $1000 at 10% annual interest, after one year the user would have $1100 (the original amount plus $100 interest) and after two years the user would have $1210 (the $1100 they started with at the beginning of the year plus the $110 interest).

The requirements of this problem are:

Prompt the user for the original amount, the type of interest, the interest rate, and whether the interest rate is annual, semi-annual, or quarterly.
Loop the program until the user chooses to quit.
Create a class that will hold methods to calculate the interest.
In the class that is used to calculate the interest, include a method to print to the screen, by interest period, the starting amount for the period, the interest earned for the period, and the total amount at the end of the period.
Submit all of your source code as plain text files with a .java extension.

Sample output ($10000 initial investment, 10% simple interest, annual, for 4 years):

Period    Beginning Amount    Interest Earned    Ending Amount   
1                   10000.00                    1000.00                11000.00
2                   11000.00                    1000.00                12000.00
3                   12000.00                    1000.00                13000.00
4                   13000.00                    1000.00                14000.00

Solution PreviewSolution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

public class Interests {

public static void printByInterestPeriod(double originalAmount, double interestRate, boolean isSimple, int totalPeriods){

// set the 1st period beginning amount to the original amount
double periodBeginningAmount = originalAmount;

// print the header line
System.out.println("\nPeriod Beginning Amount Interest Earned Ending Amount");

for(int period = 1; period <= totalPeriods; period++) {

// print the period number at the start of the line
System.out.print(period + " ");

// print the period's beginning amount
System.out.print(periodBeginningAmount + " ");

double interest = 0;

// if the interest is simple, calculate the earned interest based on the original amount
if(isSimple) {
interest = originalAmount * interestRate;
$65.00 for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Java Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Upload a file
Continue without uploading

We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats