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
iren2701 [21]
3 years ago
5

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

5 percent 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:
S_A_V [24]3 years ago
4 0

Answer:

Following are the program to this question:

import java.util.*;//import package for user input

class Interest //defining class Interest

{

   static double rate_of_interest = 5.00;//defining static double varaibale  

   public static double Invest_value()//defining method Invest_value

   {

           double invest;//defining double variable invest

           Scanner inc = new Scanner(System.in);//creating Scanner class object  

           System.out.print("Enter investment value: ");

           invest = inc.nextDouble();//input value in invest variable

           return invest;//return invest value

  }

  public static double calculated_Amount(double invest)//defining method calculated_Amount that accept parameter

  {

           double amount;//defining double variable

           amount = invest+ (invest * (rate_of_interest/100));//use amount to calculat 5 % of invest value

           return amount;//return amount value

  }

   

   public static void main(String[] as)//defining main method

   {

   double investment_value;//defining double variable

   investment_value= Invest_value();//use investment_value to hold method Invest_value value

   System.out.println("The 5% of the invest value: "+ calculated_Amount(investment_value));//use print method to print calculated_Amount value

  }

}

Output:

Enter investment value: 3000

The 5% of the invest value: 3150.0

Explanation:

In the above program a class "Interest", is defined inside the class a static double variable "rate_of_interest"  is declared that store a double value, in the next step, two methods "Invest_value and calculated_Amount" is declared.

In the "Invest_value" method, scanner class object is created for input value in the "invest" variable and the "calculated_Amount" accepts an "invest" value in its parameter and calculate its 5% and store its value in the "amount" variable.

Inside the main method, the "investment_value" is declared that holds the "Invest_value"  method value and pass the value in the "investment_value" variable in the "calculated_Amount" method and prints its return value.

You might be interested in
How can you make a search phrase more effective?
Rufina [12.5K]

Answer:

Keep it short: The fewer words you use, the more accurate your search will be. ...

Use quotes: Double quotes around a set of words tells gog.le to consider the exact words in that exact order without any change.

Search a web site: allows you to specify that your search results must come from a given website.

Explanation:

5 0
3 years ago
What internal commands can we use when in interactive mode? can we use CLS and CD?
krok68 [10]
The cd command, also known as chdir (change directory), is a command-line shell command used to change the current working directory in various operating systems. It can be used in shell scripts and batch files.
3 0
3 years ago
Computers in a medical office should be protected by which of the following security tools?
Verizon [17]
<span> it is necessary to maintain your computer on a regular basis. .... Remember these key points when recommending the Internet to a patient

Hope it helps.
</span>
8 0
4 years ago
Read 2 more answers
Your mom is trying to save room on her hard drive and wants to uninstall some of her applications. She asks you how to do this.
Olegator [25]
Press on an application, and press Ctrl and D together on a keyboard which means delete or unistall.
Is the answer supposed to be more specific?
3 0
3 years ago
Read 2 more answers
Why might you use a navigation form instead of tab pages? The navigation form allows for several levels and sublevels to be coll
boyakko [2]

Answer:

Access includes a Navigation Control that makes it easy to switch between various forms and reports in your database. A navigation form is simply a form that contains a Navigation Control. Navigation forms are a great addition to any desktop database.

Explanation:

yes

3 0
3 years ago
Read 2 more answers
Other questions:
  • What does using indirect quotations allow a writer to do?
    7·2 answers
  • What are three reasons teens might start drinking alcohol??
    7·2 answers
  • Which of the following is not one of the Fatal Four events that cause three out of five construction worker deaths? A. Caught in
    8·2 answers
  • The arguments in a method call are often referred to as ____ . The variables in the method declaration that accept the values fr
    10·1 answer
  • A woman puts on a business suit. Which post-WWII fashion does her clothing typify?
    12·2 answers
  • Which function can you perform on a word processor but not on a typewriter?
    11·1 answer
  • The Fourth Amendment does not allow police to randomly test people for drunk driving. True or False
    14·1 answer
  • Common separators or delimiters used when converting a table to text include _______________________ , paragraph marks, or comma
    14·1 answer
  • Examples of pop in computer​
    14·1 answer
  • What is it called when you define a variable for the first time
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!