1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
SCORPION-xisa [38]
4 years ago
14

Write a program that calculates the future value of an investment at a given interest rate for a specified number of years. The

formula for the calculation is as follows:futureValue = investmentAmount * (1 + monthlyInterestRate)years*12
Computers and Technology
1 answer:
baherus [9]4 years ago
8 0
<h2>Question:</h2>

Write a program that calculates the future value of an investment at a given interest rate for a specified number of years. The formula for the calculation is as follows:

futureValue = investmentAmount * (1 + monthlyInterestRate) ^ years * 12

Note: Allow users to enter the values of the investmentAmount, monthlyInterestRate and years from standard input.

Assume the number of years is always a whole number.

<h2>Answer:</h2>

===================================================

//import the Scanner class

import java.util.Scanner;

//Class header definition

public class FutureValue{

   

    //Main method definition

    public static void main(String []args){

       

       //Create an object of the Scanner class

       Scanner input = new Scanner(System.in);

       

       //Prompt the user to enter the investment amount

       System.out.println("Enter the investment amount");

       

       //Store the input in a double variable called investmentAmount

       double investmentAmount = input.nextDouble();

       

       //Next, prompt the user to enter the interest rate

       System.out.println("Enter the interest rate in percentage");

       

       //Store the input in a double variable called interestRate

       double interestRate = input.nextDouble();

       

       //Convert the interest rate to decimal by multiplying by 0.01

       interestRate *= 0.01;

       

       //Convert the interest rate to monthly interest rate by dividing the

       //result above by 12

       double monthlyInterestRate = interestRate / 12;

       

       //Prompt the user to enter the number of years

       System.out.println("Enter the number of years");

       

       //Store the input in an integer variable called years

       int years = input.nextInt();

       

       //Using the given formula, find the future value

      double futureValue =  investmentAmount * Math.pow(1 + monthlyInterestRate, years * 12);

       

       //Print out the future value

      System.out.println("Future value : " + futureValue);

       

    } //End of main method

     

}  // End of class definition

===================================================

<h2>Sample Output</h2>

===================================================

<em>>> Enter the investment amount </em>

1000

>> <em>Enter the interest rate in percentage </em>

10

>> <em>Enter the number of years </em>

5

Future value : 1645.3089347785854

===================================================

<h2>Explanation:</h2>

The code above has been written using Java. The code contains comments explaining every line of the code. Please go through the comments. The actual lines of code have been written in bold-face to distinguish them from comments. A sample output has also been provided as a result of a run of the code.

You might be interested in
You can encrypt individual files, but microsoft recommends encrypting at what level?
vichka [17]
Microsoft recommends encrypting at the folder level.
4 0
3 years ago
Multiple Choice
natta225 [31]

Answer:

information technology

6 0
3 years ago
Read 2 more answers
Why is the shade of brown important when baking flour products?
kupik [55]
I believe its just for color or something but my mom has told me its because its almost like a thickner
5 0
3 years ago
Which options or tools can be used to overlap objects on a slide? Check all that apply.
MArishka [77]

Answer:

1. Launch PowerPoint and open one of your presentations. Click the "Insert" tab on the ribbon, click the "Shapes" button and then click the "5-Point Star" shape to select it.

2. Click anywhere on your slide, hold down your left mouse button and drag it to create a star large enough to cover the object you want to overlay. For example, if you want to overlay a heading, make the star large enough to surround the heading.

3. Right-click the star and select "Format Shape" to open the Format Shape dialog box.

4. Click the "Color" button and then click the color you want to make the star.

5. Drag the "Transparency" slider until the text box next to the slider displays "90%." This value creates a star that is almost transparent but still displays the fill color.

6. Click "Close" to view your star overlay. It will be translucent and display a slight fill color that matches the color you selected.

7. Click inside the star and drag it so that it fits evenly around the object. If the star is too large or too small, click one of the handles along the star's edges and drag the handle to resize the star.

Explanation:

6 0
3 years ago
PLEASE ANSWER DUE TODAY
never [62]

Answer:

I am not sure on exactly how they want this but this is how I'd fill it out:

Also I can't see the whole question so I'll fill it out as best as I can.

Explanation:

Employee 1 - 78 hours - $2 an hour - $2,184 -

Employee 2 - Numbers of hours worked - their hourly pay - hours x hourly pay x days worked (if they work everyday for 2 weeks you'd x's it by 14.)

All I see is employee 1 and 78 hours so I tried my best!

Please mark brainliest and 5 stars, thanks!

4 0
3 years ago
Other questions:
  • - The __________ is called a single-selection statement.
    10·1 answer
  • Please answer quick:))))
    7·1 answer
  • Luchen Modo, a software development firm in Asia, launched a new software for smartphones that allowed users to remotely control
    11·1 answer
  • An ordinary office environment needs computers that have multiple user account settings where each user is allocated private dat
    13·1 answer
  • Select the layer of the OSI model that is responsible for reformatting, compressing, and/or encrypting data in a way that the ap
    14·1 answer
  • What does the CFO of a company do
    14·1 answer
  • After you have figured out your storyline, what should be the next thing to
    5·2 answers
  • Answer if you know Javascript, html, css, python, and Ruby.
    12·1 answer
  • Describe the inter-relation and linkage in between traditional knowledge, indigenous knowledge and modern technology.​
    7·1 answer
  • ## Inputs
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!