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]
3 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]3 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
Plz help!!!!!!!!!!!!!!!!111
Y_Kistochka [10]

This question stuns me. Not sure which answer it is, but my best choice right now is probably the one you have selected in the image. A line graph would show the rate of plant growth over the course of a certain amount of days, resulting in which had the highest rates within that period. Might be wrong, but I hope you do well.

4 0
3 years ago
Name the technique that uses a scheme to sum the individual digits in a number and stores the unit's digit of that sum with the
Artemon [7]

Answer:

Parity Bit

Explanation:

Given that Parity bit is a form of strategy or method that utilizes a scheme in adding a solitary bit to a binary string. This can be either 1 or 0, thereby making the total quantity of bit to become either odd parity bit or even parity bit during storage.

Hence, the technique that uses a scheme to sum the individual digits in a number and stores the unit's digit of that sum with the number is called PARITY BIT.

7 0
3 years ago
Two Technicians are discussing Tire Fitment information.
IRISSAK [1]

Only technician A is correct.

Technician A only

<u>Explanation:</u>

According to technician A, tire fitment information provides specific specs of the vehicle including the inflation pressure, OEM tire size, and lug nut tire sequences. The class of vehicles is divided into a category of vehicles and these categories are further specialized to form different models. Each model has its own specifications and their requirements differ from one another.

Hence the tire fitment of each vehicle should convey specific information about the model in concern. For instance, the optimum inflation pressure of a Royal En field will not be the same as that of Hero Splendour as both have a huge difference in their respective weight and size.

4 0
3 years ago
Difference and similarity between cluster computing and Hadoop ecosystem?<br>​
Marysya12 [62]
  • Some things can be similar and still have some differences. The Hadoop ecosystem is known to be the add-ons that make the Hadoop framework more better for some particular big data needs and tastes.

The Hadoop ecosystem is made up of the open source projects and commercial tools that are often optimized to act on different kinds of work especially to big data. It is very flexible

The differences is that cluster is simply a combination of a lot of computers that is set up to work together as one system but a Hadoop cluster is a cluster of computers that is used only at Hadoop. Hadoop clusters are set up to analyze and storing large amounts of unstructured data only in a distributed file systems.

Learn more about systems from

brainly.com/question/10603992

7 0
2 years ago
Read 2 more answers
Which is the best practice for placing graphics on a slide?
lbvjy [14]
All the choices depend on the slide and the last one is a must. the first one should be for the introduction and conclusion and the second one should be used to make ideas conveyed in the presentation easier to understand.
5 0
3 years ago
Read 2 more answers
Other questions:
  • After calling the customer service line of Delta airlines, Francis received an email asking her to fill out customer satisfactio
    9·1 answer
  • What operating system was most commonly used by early personal computers? Apple Mac MS-DOS Windows
    6·2 answers
  • 9.10: Reverse ArrayWrite a function that accepts an int array and the array ’s size as arguments . The function should create a
    9·1 answer
  • In the LC-3, how many memory words are used to store the string "rainbow"?
    11·1 answer
  • Java
    14·1 answer
  • Is it safe to tape down cords such as internet cables to the floor?
    14·1 answer
  • Which of the following represent advantages of GPL-licensed software? Check all of the boxes that apply It is always free of cos
    12·2 answers
  • Can someone help me write an algorithm and a flow chart pls for question 3
    7·1 answer
  • HELP ME PLEASE ASAP
    6·1 answer
  • Unconformities develop when new sedimentary layers accumulate atop old, eroded layers, resulting in a geologic hiatus. Which of
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!