Question

Lab 1 Deliverable: Lab Report Please include the source code of each task in a separate.java file. Please add code in Lab 1.1
0 0
Add a comment Improve this question Transcribed image text
Answer #1
 import java.util.*; import java.lang.Math.*; class Main {     //Main method   public static void main(String args[])  {               double futureVal;               //Scanner class object          Scanner reader = new Scanner(System.in);                //Getting values from user              System.out.print("Enter investment amount: ");          double invAmt = reader.nextDouble();                                    System.out.print("Enter yearly interest rate: ");               double annInt = reader.nextDouble();                            System.out.print("Enter number of years: ");            int noYrs = reader.nextInt();                   //Generating future Value               futureVal = futureInvestmentValue(invAmt, ( (annInt / 100.0) / 12.0), noYrs);           //Printing result               System.out.printf("\nAccumulated Value is %.2f\n", futureVal);  }       //Method that calculates future value   public static double futureInvestmentValue(double investmentAmount, double monthlyInterestRate, int years)      {               //Calculating Future value              return investmentAmount * Math.pow( (1 + monthlyInterestRate ) , (years*12) );  } }

Sample Run:

Accumulated Value is 1043.34

Add a comment
Know the answer?
Add Answer to:
Lab 1 Deliverable: Lab Report Please include the source code of each task in a separate.java...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Computing Future Investment Value Problem Description: Write a method that computes future investment value at a...

    Computing Future Investment Value Problem Description: Write a method that computes future investment value at a given interest rate for a specified number of years. The future investment is determined using the following formula: 12 futurelnvestmentValue investmentAmountx(1+ monthlylnterestRate) Use the following method header: publie static double futureInvestnentValue double investnentAmount, double monthlyInterestRate, int years) For example, futur Investmentvalue( 1eeee, อ.es/12, 5) returns 12833.59 Write a test program that prompts the user to enter the investment amount (e.g. 1000) and the interest...

  • Using basic c++ write a separate code for each of the following: 1. Area Rectangle •...

    Using basic c++ write a separate code for each of the following: 1. Area Rectangle • Write a program that asks the user to enter length and width of a rectangle and then display the rectangles area. • Write the following functions • getLength – prompt the user to enter length and return that value as a double • getWidth – prompt the user to enter width and return that value as a double • getArea – This method should...

  • Hurry up Please help me : C++ Enter property zip code: 95148 Enter property address: 2613...

    Hurry up Please help me : C++ Enter property zip code: 95148 Enter property address: 2613 Aborn Rd, San Jose CA Enter property offer price (principal): $312500 Enter down payment (in percentage %): 20.0 Enter annual interest rate (in percentage %): 5.75 Enter number of years financing: 15 Mortgage calculator is processing your data ... Please wait...                      **************************************                       MORTGAGE CALCULATOR RESULTS                      ************************************** Property address: 2613 Aborn Rd, San Jose CA 95148 Property offer price:                                       $...

  • Python Code, please 2.28 Domain Lab 4.1 -- Simple interest Calculator Simple Interest Calculator Your program...

    Python Code, please 2.28 Domain Lab 4.1 -- Simple interest Calculator Simple Interest Calculator Your program should ask the user (in this order) for: Principal Annual Interest Rate Time Period (years) Your program should then calculate and display: Total Interest Generated Total Future Value

  • Please use public class for java. Thank you. 1. (10 points) Write a method that computes...

    Please use public class for java. Thank you. 1. (10 points) Write a method that computes future investment value at a given interest rate for a specified number of years. The future investment is determined using the formula futurelnvestmentValue numberOfYears 12 investmentAmount X ( monthlyInterestRate) Use the following method header: public static double futurelnvestmentValue( double investmentAmount, double monthlyInterestRate, int years) For example, futureInvestmentValue 10000, 0.05/12, 5) returns 12833.59. Write a test program that prompts the user to enter the investment...

  • C++ : Please include complete source code in answer This program will have names and addresses...

    C++ : Please include complete source code in answer This program will have names and addresses saved in a linked list. In addition, a birthday and anniversary date will be saved with each record. When the program is run, it will search for a birthday or an anniversary using the current date to compare with the saved date. It will then generate the appropriate card message. Because this will be an interactive system, your program should begin by displaying a...

  • Please add code for program. movies.txt file. LAB 14-2 Plan and Create In this lab, you...

    Please add code for program. movies.txt file. LAB 14-2 Plan and Create In this lab, you will plan and create an algorithm for Cheryl Liu, the owner of a candy shop named Sweets-4-You. The problem specification is shown in Figure 14-15. Problem specification Cheryl Liu is the owner of a candy shop named Sweets-4-You. She wants a program that displays the following menu: Menu Options 1 Add Records 2 Display Total Sales 3 Exit If Cheryl selects option 1, the...

  • Please help me do this program. Add some comments on it. *15.5 (Create an investment-value calculator)...

    Please help me do this program. Add some comments on it. *15.5 (Create an investment-value calculator) Write a program that calculates the future value of an investment at a for the calculation is given interest rate for a specified number of years. The formula investmentAmount * (1monthlyInterestRate ) years *12 futureValue Use text fields for the investment amount, number of years, and annual interest rate. Display the future amount in a text field when the user clicks the Calculate button,...

  • In this exercise, you’ll modify the Future Value Calculator application to include a header and footer....

    In this exercise, you’ll modify the Future Value Calculator application to include a header and footer. Review the project Open the header.jsp file and note that it contains the code necessary for the start of an HTML page including the opening html, head, and body tags, the title for the web page, and a link including the CSS file. Open the footer.jsp file and note that includes a copyright notice and the closing body and html tags. Modify the code...

  • ***Please use java code for the question below*** Write a program that calculates the future value...

    ***Please use java code for the question below*** Write a program that calculates the future value of a given investment at a given interest rate for a specified number of years. The formula for this calculation is: value = investmentAmount * (1 + monthly interest rate)years*12 Use text fields for the user to enter the numbers (Investment Amount, Number of Years, and Annual Interest). To get/load data from the textbox, (in this case doubles) use the following structure: (bold are...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT