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
Rebecca completed work on a computer and is verifying the functionality of the system when she finds a new problem. This problem
Sergio039 [100]

Rebecca should Determine whether fixing the first problem caused the second problem.

d. Determine whether fixing the first problem caused the second problem.

<u>Explanation:</u>

Rebecca completed work on the computer and is verifying the functionality of the system when she finds a new problem.

Keeping in mind the fact that Rebecca's company's policy is that all problems need to be reported and given a priority code before they can be assigned to someone, she should go ahead and determine whether fixing the first problem caused the second problem to arise.

Although the company's policy does not approve of this, before reporting a problem she should check whether the problem is worth the effort. As mentioned, the problem is not urgent and can easily be fixed, she should go ahead with this option.

7 0
3 years ago
Data is communicated through various input devices true or false​
kipiarov [429]
I would believe this is true if the following are also true.

Input devices are things like keyboards, mouses, buttons, e.c.t.

If that is true then I would believe it to be true due to multiple inputs are being used to communicate.
3 0
3 years ago
(C Language) Write a program to display a histogram based on a number entered by the user. A histogram is a graphical representa
Kobotan [32]

Answer:

Explanation:

Note: Could you plz go through this code and let me know if u need any changes in this.Thank You

=================================

#include <stdio.h>

#include <stdlib.h>

#include <ctype.h>

#include <string.h>

int main() {

  //Declaring constants

const int MIN=1;

  const int MAX=40;

 

  //Declaring variables

  int num,i;

      printf("Enter a non-zero positive number less than 40: ");  

     

     

/* This while loop continues to execute

* until the user enters a number <=0

*/

  while(1)

  {

      scanf("%d",&num);

      if(num<=0)

      {

          break;

      }

      else if(num>40)

      {

      printf("The number entered was greater than %d.\n",MAX);

          printf("Please re-enter: ");

      }

      else

      {

          for(i=0;i<num;i++)

          {

              printf("*");

          }

          printf("%d\n",num);

          printf("Enter another non-zero positive number less than 40: ");

      }

         

  }

 

  printf("bye...");

  return 0;

 

}

================================

output:

Enter a non-zero positive number less than 40:5

*****5

Enter another non zero positive number less than 40: 48

The number entered was greater than 40.

please Re-enter: 8

********8

Enter another non zero positive number less than 40: 1

bye...

---------------------------------------------

Process exited after 15.48 seconds with return value 0

Press any key to continue.......

3 0
4 years ago
VOTE: STARWARS, STAR TREK, MARVEL, STRANGER THINGS. OR IT ?
Gennadij [26K]
I'd say stranger things or it lol
5 0
3 years ago
Read 2 more answers
Help me please!! It would be appreciated :)
IgorC [24]

the tool that you use is called Lens Correction.

Hope this helped

-scav

6 0
3 years ago
Read 2 more answers
Other questions:
  • A knowledge and skills test is a tool support managers use when selecting new employees; it measures an applicant's understandin
    13·1 answer
  • Grace is the sub-editor in a business firm. which feature of a word processing program would she use to make her changes visible
    14·1 answer
  • When hundreds, thousands, or even hundreds of thousands of zombie computers are gathered into a logical computer network under t
    6·2 answers
  • Conduct online research on web authentication and define what it is. Describe different authentication methods
    5·1 answer
  • A hotel salesperson enters sales in a text file. Each line contains the following, separated by semicolons: The name of the clie
    8·1 answer
  • Which is an example of a table style option?
    7·1 answer
  • Central High School has a graphics design course that is developing a historical online archive of the school. The original phot
    15·2 answers
  • What principle of animation helps facial features to be noticed?
    7·2 answers
  • The TCP/IP stack has five layers, namely application, transport, network, link, and physical.
    12·1 answer
  • A blueprint or a "print" needs to
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!