Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

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

Explain that the biggest problems with adware is that it

Explain that the biggest problems with adware is that it slows down the computers its running on.

Recall the definition of a complete graph kn is a graph

Recall the definition of a complete graph K_n is a graph with n vertices such that every vertex is connected to every oilier vertex. Recall also that a clique is a complete subset of some graph. The graph coloring proble ...

Take a tour of your building on campus or at work what is

Take a tour of your building on campus or at work. What is secured at night when workers are absent? Record the location and type of physical access control devices. How do these access controls change at night when work ...

Suppose that you have 5000 and you are contemplating the

Suppose that you have $5000 and you are contemplating the purchase of two investments, IBM and Walgreen's. One year from now, IBM can be sold at $ X per dollar invested, and Walgreen's can be sold for $ Y per dollar inve ...

Suppose a punched card has 80 columns and 12 rowsa if any

Suppose a punched card has 80 columns and 12 rows. (a) If any number of holes can be punched in the card, how many different cards can there be. If more convenient, you may give your answer in the form of an expression. ...

A standard 52 card playing deck assigns a unique

A standard 52 card playing deck assigns a unique combination of 13 ranks (2,3,4,5,6,7,8,9,10,J,Q,K,A) and 4 suits (Clubs, Diamonds, Hearts, Spades) to each card (13  4 = 52). Suppose 5 cards are selected at random. Deriv ...

What is the importance of selling and salesmanship within a

What is the importance of selling, and salesmanship within a small business?

Task working with arrays in matlabnbspcreate a matlab

Task : Working with Arrays in MatLab  Create a MatLab script called a2taski.m that computes the following tasks. The answers will appear in the Workspace. To view the larger structures, e.g., matrix A in Part 1 double cl ...

The correlation between the height of fathers in the

The correlation between the height of fathers in the heights of their sons is r=0.52. Which kind of the following would not change r? a) measuring their height in centimeters rather than inches. b) removing two outliers ...

Below is a simple data gird with a header

Below is a simple data gird with a header row. kim|taylor|clara|654 763 1345|75|2016-01-17|null|N|90.76|A jack|jenkins|joseph|630 654 0265|92|2016-11-30|null|Y|131.00|B Identify what rules would you apply for ensuring th ...

  • 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