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
Why are men more exposed to mass media?
adell [148]

Answer:

because they like exploring

8 0
2 years ago
Read 2 more answers
Memory chips are used in ____ storage devices to read and write data
MakcuM [25]
Solid state storage?
There are three different types,
Like RAM, ROM, SSS

5 0
3 years ago
allows Internet telephony service providers to deliver telephony services and unified communications applications offering voice
hram777 [196]

Answer:

VoIP

Explanation:

Voice over Internet Protocol. You can share videos, data, voice and other applications.

3 0
3 years ago
PLEASE HELP!
Morgarella [4.7K]
An query because his ideas are effective
8 0
4 years ago
Read 2 more answers
What invention during the renaissance period enabled people to purchase music for their own personal use?
bogdanovich [222]
Printing press_____________________________________________________                                                        
6 0
3 years ago
Read 2 more answers
Other questions:
  • Why would the filename minutes from the meeting not be a good file name choice
    14·1 answer
  • Plssss helpppp!!<br><br>Thanks
    11·2 answers
  • By default, EC2 instances pull SQS messages from an SQS queue on a FIFO basis.
    6·1 answer
  • Why might it be a good idea to choose a bus topology?
    6·2 answers
  • What file in the user account folder stores user settings?
    8·1 answer
  • What is the full form of RAM. ​
    5·2 answers
  • What is subscriber billing in Google Play and where does the money go?
    5·1 answer
  • Many people in the United States will say that they have rights, however, the majority of those people do not know what those ri
    15·2 answers
  • Mr. O would like to purchase a new computer for his home business. Mr. O's current computer runs very slow when he is running e-
    5·2 answers
  • Who wants 100 points? comment buh. i don't rlly care buh.
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!