Ask Computer Engineering Expert

Problem Description

This lab assignment is to improve the solution of computing the monthly saving problem in Lab Assignment 3 by using a loop to eliminate the repeated calculations. That is, all the requirements of Lab 3 remain the same, but the solution to the problem is changed.

Assignment Requirements

The requirements of Lab 3 remain the same except the following changes:

1) Modify the flowchart diagram for Lab 3 assignment to reflect the change of the solution, i.e., the use of a loop to replace the repeated calculations.

2) Modify the pseudo-code in Lab 3 Assignment, accordingly.

3) Continue to use the JOptionPane class for all input and output, instead of the Scanner object.

4) Perform all input data error checking as required in Lab 3.

(The above requirements are also applicable to the bonus problem.)

The following three test runs in Lab Assignment 3 should be rerun to confirm the program produces the correct answers:

 

Saving Amount

Annual Interest Rate

Compound Value after 6th Month

Test run 1

100

5.0

608.81

Test run 2

150

5.0

913.22

Test run 3

100

5.5

609.70

When the monthly saving amount or the annual interest rate or both are not positive, your program should display informative error messages. Your test case should include the following three possible casesIt is your choice of the test data covering those three test cases listed above.

Saving Amount

Annual Interest Rate

Positive

Not positive

Not positive

Positive

Not positive

Not positive


Submission Requirements

Your assignment submission should be prepared as follows:

1) The flowchart diagram document

2) The Java source code file (i.e., *.java file) you write for this assignment

3) The MS Word document containing the screen captures of all test cases you run, making sure the screens show the input and output. To receive the credit for completing testing, your screen captures should include all test cases as specified above.

Submit all files above into the dropbox of this assignment.

(Bonus Problem:

Enhance the function of the application to allow the user to compare the compound values of different annual interest rates. The user enters the monthly saving amount and an annual interest rate. The program computes the compound value after month 6 and display the result.
The program then asks if the user wants to compute the compound value of a different rate using the Java confirmation dialog box. If the user clicks the Yes button, the program should then prompt the user to enter a new set of data and repeat the same calculation. If the user clicks the No button, the program would then end. The user should be able to try several different rates.
Successful completion of this task will add 25 points to the assignment.)


Assignment Assessment
The assessment rubric for the assignment is below:

Task Items

Complete & Correct

Incomplete/
Partially Correct

Missing

Solution Design
(flowchart diagram) (15%)

100%

By %

0

Solution Pseudo-Code (Java comments) (10%)

100%

By %

0

Java Program (60%)

100%

By %

0

Testing Completeness (15%)

100%

By %

0

Problem Description

The calculation of the compound value we have done in the last three assignments is a very common financial calculation in many financial applications. For example, producing the monthly account statements requires calculating the compound value of bank accounts. Thus, making the calculation readily available to financial applications can reduce the development effort and improve the quality of those applications.

Java methods allow us to package such financial calculations into reusable methods so that they are ready to be invoked by financial applications. This lab assignment is to improve the solution of computing the monthly saving problem in Lab Assignment 4 by extracting the calculation of the compound value into a separate method. The main learning objective is to understand method definition, parameter passing, and method invocation.

Assignment Requirements

Create a new method to calculate the compound value of monthly savings. The requirements of the new method are described below:

1) The modifiers of the method should be public static so that it can be called by the main method

2) The method should return the calculated compound value and the return value type of the method is of double type

3) The name of the method is your choice but should be descriptive and follow the Java naming convention.

4) The parameter list of the method should consist of the following three parameters:

a. The amount of monthly saving (double type)

b. The annual interest rate (double type)

c. The number of months (int type) of the compound value

5) The method should perform the following tasks:

a. Validate each parameter. If a parameter is not positive, display an error message and terminate the method by returning a negative compound value to signal that the calculation failed. Note that it takes only one data error to terminate the calculation.

b. If all parameters are positive, use a loop to calculate the compound value same as you did in Lab Assignment 4. The number of months to repeat is determined by the number of months parameter passed into the method.

c. After the calculation is completed, return the compound value after the given number of months.

The main method is now simplified to do only the following tasks:

1) Prompt the user to input the data and read the data entered by the user.

2) Call the new method to calculate the compound value by passing the monthly saving, annual interest rate, and the number of months as arguments and save the compound value returned by the method

3) If the compound value returned by the method call is positive, display the compound value. Otherwise, simply end the execution of the main method because the error message has already been reported in the method.

Because of the above changes, the flowchart diagram of Lab Assignment 4 should be modified to reflect the changes taken place in your program. If you did the bonus problem in Lab Assignment 4, you may use either your bonus solution or the regular solution as the base for this assignment

The requirement of using GUI dialog boxes for all input and output remains unchanged.

You should run the same number of test cases as required in Lab Assignment 4.

Bonus: 10% of your total score on this assignment will be added to your assignment grade

Submission Requirements

Your assignment submission should include the following items:

1) The modified flowchart diagram

2) The Java source code file (i.e., *.java file)

3) The screen captures of all test cases you run; only the dialog boxes need to be captured.

Submit all those files above into the dropbox of this assignment.

Assignment Assessment

The assessment rubric for the assignment is below:

Task Items

Complete & Correct

Incomplete/
Partially Correct

Missing

Solution Design
(flowchart diagram) (15%)

100%

By %

0

Solution Pseudo-Code (Java comments) (10%)

100%

By %

0

Java Program (60%)

100%

By %

0

Testing Completeness (15%)

100%

By %

0

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91420541
  • Price:- $30

Priced at Now at $30, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Does bmw have a guided missile corporate culture and

Does BMW have a guided missile corporate culture, and incubator corporate culture, a family corporate culture, or an Eiffel tower corporate culture?

Rebecca borrows 10000 at 18 compounded annually she pays

Rebecca borrows $10,000 at 18% compounded annually. She pays off the loan over a 5-year period with annual payments, starting at year 1. Each successive payment is $700 greater than the previous payment. (a) How much was ...

Jeff decides to start saving some money from this upcoming

Jeff decides to start saving some money from this upcoming month onwards. He decides to save only $500 at first, but each month he will increase the amount invested by $100. He will do it for 60 months (including the fir ...

Suppose you make 30 annual investments in a fund that pays

Suppose you make 30 annual investments in a fund that pays 6% compounded annually. If your first deposit is $7,500 and each successive deposit is 6% greater than the preceding deposit, how much will be in the fund immedi ...

Question -under what circumstances is it ethical if ever to

Question :- Under what circumstances is it ethical, if ever, to use consumer information in marketing research? Explain why you consider it ethical or unethical.

What are the differences between four types of economics

What are the differences between four types of economics evaluations and their differences with other two (budget impact analysis (BIA) and cost of illness (COI) studies)?

What type of economic system does norway have explain some

What type of economic system does Norway have? Explain some of the benefits of this system to the country and some of the drawbacks,

Among the who imf and wto which of these governmental

Among the WHO, IMF, and WTO, which of these governmental institutions do you feel has most profoundly shaped healthcare outcomes in low-income countries and why? Please support your reasons with examples and research/doc ...

A real estate developer will build two different types of

A real estate developer will build two different types of apartments in a residential area: one- bedroom apartments and two-bedroom apartments. In addition, the developer will build either a swimming pool or a tennis cou ...

Question what some of the reasons that evolutionary models

Question : What some of the reasons that evolutionary models are considered by many to be the best approach to software development. The response must be typed, single spaced, must be in times new roman font (size 12) an ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As