Question
The goal of Java program(s) implemented as part of this assignment is: 1. To use for, while, do-while loops to solve the given problem(s) 2.
The goal of Java program(s) implemented as part of this assignment is: 1. To use for, while, do-while loops to solve the given problem(s) 2. Write custom method(s) Note: Be sure to document your code thoroughly. In other words, you must comment each pertinent line of code to briefly state what it is intending to do.
Requirement-1
In the Requirement-1 you will create a program named ComputeCompoundInterest, that will compute compound interest using the formula as follows: amount = principal * ( 1 + rate )numYears (a) Ask the user to enter the following 3 data elements: (i) The Principal (ii) The Interest Rate (iii) The Number of Years (b) You will write the following 3 custom methods, each using a different loop type to compute and print compound interest using the above mentioned formula: (i) computeWhile (ii) computeDoWhile (iii) computeFor March 2, 2019 page 3 (c) Each method will take 3 parameters, as mentioned in (a) above, with the right type, and will not be returning anything. So be sure the method signature is defined the right way. Hint: return value should be void (d) Each of the 3 methods should be called/invoked from the main() method of your class (e) The output from each of the 3 methods should look like the following. The number of rows of output will depend on the number of years entered by the user input. Sample output should like the following: Output from while loop: Year 1 Amount: $xxx Year 2 Amount: $yyy .. .. Output from do-while loop: Year 1 Amount: $xxx Year 2 Amount: $yyy .. .. Output from for loop: Year 1 Amount: $xxx Year 2 Amount: $yyy .. .. Note: Please add a blank line after the output from each method is completed
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started