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
Define lan wan &amp; man
Anuta_ua [19.1K]
A LAN (local area network) is a group of computers and network devices connected together, usually within the same building. By definition, the connections must be high speed and relatively inexpensive (e.g., token ringor Ethernet). Most Indiana University Bloomington departments are on LANs.

A LAN connection is a high-speed connection to a LAN. On the IUB campus, most connections are either Ethernet (10 Mbps) or Fast Ethernet (100 Mbps), and a few locations have Gigabit Ethernet (1000 Mbps) connections.

A MAN (metropolitan area network) is a larger network that usually spans several buildings in the same city or town. The IUB network is an example of a MAN.

A WAN (wide area network), in comparison to a MAN, is not restricted to a geographical location, although it might be confined within the bounds of a state or country. A WAN connects several LANs, and may be limited to an enterprise (a corporation or an organization) or accessible to the public. The technology is high speed and relatively expensive. The Internet is an example of a worldwide public WAN.

3 0
3 years ago
Give 3 reasons why it is believed that smart phones precent us from communicating face to face.give three reasons why it is beli
gregori [183]

Answer:

yes

Explanation:

because the people will be lazy to go and talk to that person instead They will call each other and discuss

7 0
1 year ago
Create a class called Book with the following properties using appropriate data types: Title, Author, numberOfPages, Create a se
tamaranim1 [39]

Answer:

I don't know the answer sorry

7 0
3 years ago
listen to exam instructions a small business called widgets, inc. has hired you to evaluate their wireless network security prac
Alex

Following actions could you most likely advise the client taking to strengthen the security of their wireless network-

  • Change the default SSID to anything different.
  • Turn off SSID broadcasting.
<h3>Explain the term wireless network security?</h3>
  • Designing, putting into practice, and ensuring security on such a wireless computer network are all parts of wireless network security.
  • A wireless computer network is further protected by this subset of network security.
  • Wireless security is another name for wireless network security.

For the stated question-

  • Disabling SSID broadcast and changing the network name are advised.
  • By disabling SSID, the network name won't be displayed on devices looking for a network can connect to, and so by changing the name, it will be impossible for anyone who already knows the old name to connect.
  • Both of which significantly boost security.

To know more about the wireless network security, here

brainly.com/question/28257213

#SPJ4

3 0
1 year ago
Write a Console Java program to implement the following Sorting Program.
belka [17]

Answer:

Complete working code is available now.

Explanation:

Visit: gotit-pro.com/write-a-console-java-program-to-implement-following

Feel free to reach out to me for fastest, top-notch and impeccable homework help.

Thanks and Best Regards: Your Friendly Study Co-Pilot

6 0
2 years ago
Other questions:
  • Select the correct answer.
    6·1 answer
  • What is &lt;html&gt;
    9·2 answers
  • The term that describes the connection of all kinds of devices; computers, phones, laptops, appliances, cars, etc. to the intern
    7·1 answer
  • The command button to protect a document is part of the​.
    10·1 answer
  • Tomahawk Industries develops weapons control systems for the military. The company designed a system that requires two different
    13·1 answer
  • What is the penalty for violating section 1201 of title 17 chapter 21 of the us code
    15·1 answer
  • What are the possible consequences of intentional virus setting?
    14·1 answer
  • Nate wants to copy the style of his contact address to the normal template. Complete the paragraph to describe how he can access
    12·2 answers
  • The components of hardware include:
    6·2 answers
  • Part 2: Code the Program
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!