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
Anon25 [30]
3 years ago
5

Write an application that calculates and displays the amount of money a user would have if his/her money could be invested at 5%

interest for one year. Create a method that prompts the user for the starting value of the investment and returns it to the calling program. Call a separate method to do the calculation and return the result to be displayed. Save the program as Interest.java
Computers and Technology
1 answer:
12345 [234]3 years ago
5 0

Answer:

// Application in java.

// package

import java.util.*;

// class definition

class Main

{

  // method for calculating interest

  public static float calculateInterest(float start_bal,float i_Rate)

  {

  // calculate return

     float return_Amount=start_bal+(start_bal*(i_Rate/100));

     // return

    return return_Amount;

  }

// main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

         // scanner Object to read the input

         Scanner sc = new Scanner(System.in);

         // variables

         float start_bal;

         float i_Rate=5;

         // ask to enter start money

        System.out.print("Enter start money:");

        // read start money

        start_bal=sc.nextFloat();

        // call the function and print the return amount

        System.out.println("5% interest earned on $" + start_bal + " after one year is $" + calculateInterest(start_bal,i_Rate));

   }catch(Exception ex){

       return;}

}

}

Explanation:

Declare and initialize interest rate with 5.Then read the start money from user.Then call the method calculateInterest() with parameter start_bal and i_Rate.It will calculate the return amount after 1 year.Print the returned amount in main method.

Output:

Enter start money:1500

5% interest earned on $1500.0 after one year is $1575.0

You might be interested in
A database is used to _____.
Cloud [144]
A database is used to organize a large collection of data, hence the name database. It is literally a base that would contain a chunk of data that a person or an organization will need to pull out later when they need it. Databases are usually used by companies or organizations
5 0
4 years ago
Read 2 more answers
PLEASE ANSWER ASAP! THANKSSSSS
tankabanditka [31]
That is hard .....……
5 0
3 years ago
What is the internet protocol that web browsers use to request and display web pages using universal resource locators?
Rzqust [24]
HTTP protocol, stands for HyperText Transfer Protocol
6 0
3 years ago
A (n) _____, similar to a trojan horse, installs monitoring software in addition to the regular software that a user downloads o
galina1969 [7]

Answer:

Spyware

Explanation:

Internet is a type of computer network that allow device communicate with each other world wide. So, it is not the correct option.

Worm: this is a standalone malware computer program that replicates itself in order to spread to other computers. It spreads copies of itself from computer to computer. A worm can replicate itself without any human interaction, and it does not need to attach itself to a software program in order to cause damage. The major feature of a worm is ability to replicate on it own. So, it is not the correct option.

Bot: this is a software application that runs automated tasks. So, it is not the correct option.

Middleware: this is software that lies between an operating system and the applications running on it, enabling communication and data management. It provides services to software applications beyond those available from the operating system. So, it is not the correct option.

Spyware: this is the correct answer. Spyware is similar to trojan horse because it hides itself in a system and a user may not know that it exist on the system. Spyware is a form of malware that hides on your device, monitors your activity, and steals sensitive information without knowledge of the user.

5 0
3 years ago
Read 2 more answers
Cho 1 biến x thuộc kiểu dữ liệu Integer , hãy cho biết biến x dùng để làm gì?
denis23 [38]

Answer:

???

Explanation:

4 0
3 years ago
Other questions:
  • If you are upgrading your operating system to Windows 7, you may not use the In-Place Upgrade Installation Option with
    14·1 answer
  • I need a free flashdrive can anyone tell me any website links so i can get one for free????​
    11·1 answer
  • The set of rules for how computers talk to one another
    6·1 answer
  • Compare and contrast the role that business users play when software is developed using Waterfall and Agile software development
    10·1 answer
  • The Business Information Building Block feature is available in the _____ grouping on the Insert tab.
    13·1 answer
  • Lazarus Consulting is a large computer consulting company in New York. Pete Lazarus, theà CEOà and founder, is well known for hi
    8·1 answer
  • What are control layouts? What are the two primary control layout options?
    13·1 answer
  • Explain how data structures and algorithms are useful to the use of computer in data management<br>​
    10·1 answer
  • Who wrote the book of luke​
    7·1 answer
  • What is the output for the following program?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!