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]
2 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]2 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
I WILL GIVE BRAINLIEST TO WHO ANSWERS FIRST AND CORRECTLY.
bogdanovich [222]

Answer:

True

Explanation:

3 0
3 years ago
Determine and prove whether an argument in English is valid or invalid. About Prove whether each argument is valid or invalid. F
yawa3891 [41]

Answer:

Each understudy on the respect roll got an A.  

No understudy who got a confinement got an A.  

No understudy who got a confinement is on the respect roll.  

No understudy who got an A missed class.  

No understudy who got a confinement got an A.  

No understudy who got a confinement missed class  

Explanation:

M(x): x missed class  

An (x): x got an A.  

D(x): x got a confinement.  

¬∃x (A(x) ∧ M(x))  

¬∃x (D(x) ∧ A(x))  

∴ ¬∃x (D(x) ∧ M(x))  

The conflict isn't considerable. Consider a class that includes a lone understudy named Frank. If M(Frank) = D(Frank) = T and A(Frank) = F, by then the hypotheses are overall evident and the end is counterfeit. Toward the day's end, Frank got a control, missed class, and didn't get an A.  

Each understudy who missed class got a confinement.  

Penelope is an understudy in the class.  

Penelope got a confinement.  

Penelope missed class.  

M(x): x missed class  

S(x): x is an understudy in the class.  

D(x): x got a confinement.  

Each understudy who missed class got a confinement.  

Penelope is an understudy in the class.  

Penelope didn't miss class.  

Penelope didn't get imprisonment.  

M(x): x missed class  

S(x): x is an understudy in the class.  

D(x): x got imprisonment.  

Each understudy who missed class or got imprisonment didn't get an A.  

Penelope is an understudy in the class.  

Penelope got an A.  

Penelope didn't get repression.  

M(x): x missed class  

S(x): x is an understudy in the class.  

D(x): x got a repression.  

An (ax): x got an A.  

H(x): x is on the regard roll  

An (x): x got an A.  

D(x): x got a repression.  

∀x (H(x) → A(x)) a  

¬∃x (D(x) ∧ A(x))  

∴ ¬∃x (D(x) ∧ H(x))  

Real.  

1. ∀x (H(x) → A(x)) Hypothesis  

2. c is a self-self-assured element Element definition  

3. H(c) → A(c) Universal dispatch, 1, 2  

4. ¬∃x (D(x) ∧ A(x)) Hypothesis  

5. ∀x ¬(D(x) ∧ A(x)) De Morgan's law, 4  

6. ¬(D(c) ∧ A(c)) Universal dispatch, 2, 5  

7. ¬D(c) ∨ ¬A(c) De Morgan's law, 6  

8. ¬A(c) ∨ ¬D(c) Commutative law, 7  

9. ¬H(c) ∨ A(c) Conditional character, 3  

10. A(c) ∨ ¬H(c) Commutative law, 9  

11. ¬D(c) ∨ ¬H(c) Resolution, 8, 10  

12. ¬(D(c) ∧ H(c)) De Morgan's law, 11  

13. ∀x ¬(D(x) ∧ H(x)) Universal hypothesis, 2, 12  

14. ¬∃x (D(x) ∧ H(x)) De Morgan's law, 13  

4 0
3 years ago
What is the output produced from the following statements? System.out.println("\"Quotes\""); System.out.println("Slashes \\//");
jekas [21]

Answer:

"Quotes"

Slashes \//

How '"confounding' "\" it is!

Explanation:

The question above is testing your knowledge of  the "\" escape sequence, This escape sequence is used to introduce special formatting to the output of the System.out.print function in Java.

It can be used to introduce a new line \n

It can also be used to introduce a tab indentation \t

As in the question above it is used to introduce double quotes "" in this case \"

Also as we see the question above it can still be used to place backlashes to an output in this case we use two backlashes \\. The first is the escape sequence, the second \ gets printed out.

3 0
3 years ago
In the main function, define five variables of type int, named: first, second, third, fourth, and total. Also in the main functi
fiasKO [112]

Answer:

  1. import java.util.Scanner;
  2. public class num8 {
  3.    public static void main(String[] args) {
  4.    int first, second, third, fourth,total;
  5.    double decimalOne, decimalTwo, decimalTotal;
  6.    }
  7.    public static void getData(int first, int second, int third, int fourth, double decimalOne, double decimalTwo){
  8.        System.out.println("Enter the Values");
  9.        Scanner in = new Scanner(System.in);
  10.        first=in.nextInt();
  11.        second=in.nextInt();
  12.        third=in.nextInt();
  13.        fourth=in.nextInt();
  14.        decimalOne = in.nextDouble();
  15.        decimalTwo = in.nextDouble();
  16.    }
  17.    public static int computeTotal(int first, int second, int third){
  18.        return first+second+third;
  19.    }
  20.    public static int computeTotal(int first, int second, int third, int fourth){
  21.        return first+second+third+fourth;
  22.    }
  23.   public static double computeTotal(double decimalOne, double decimalTwo){
  24.        return decimalOne+decimalTwo;
  25.    }
  26.    public static void printAll( int first, int second, int third){
  27.        System.out.println("Number one, two and three are: "+first+" "+second+" "+third);
  28.    }
  29.    public static void printAll( int first, int second, int third, int fourth){
  30.        System.out.println("Number one, two and three and four are: "+first+" "+second+
  31.                " "+third+" "+fourth);
  32.    }
  33.   public static void printAll( int first, int second, int third, int fourth, int fifth){
  34.        System.out.println("Number one, two and three and four are: "+first+" "+second+
  35.                " "+third+" "+fourth+" "+fifth);
  36.    }
  37.    public static void printAll( double first, double second, double third){
  38.        System.out.println("Number one, two and three and four are: "+first+" "+second+
  39.                " "+third);
  40.    }
  41. }

Explanation:

This solution is provided in Java:

All the variable declarations are done in the main method (lines 3-6)

Eight methods as specified in the question are created (Lines 7, 17, 20, 23, 26, 29, 33 and 37).

Observe the concept of Method Overloading (i.e. methods with same name and return types but different parameter list)

8 0
3 years ago
How to change the size of my document in cs6?
Aleonysh [2.5K]
When you're saving your image, it will ask you what quality of the image you want to use and it will show you that you're using a larger or smaller filesize depending on the quality of the image your saving.

<TIP>  Make a duplicate layer before saving the image and uncheck the original. Always save the CS6 file too to re-edit later if need be. But that way you will have the file size you want and the original image is preserved
5 0
3 years ago
Other questions:
  • Which of the following is not a type of user account? A. Administrator b. Guest c. Group d. Standard
    10·1 answer
  • The interaction between information technology and organizations is influenced___________.A) solely by the decision making of mi
    12·1 answer
  • Discuss trends in cellular data transmission speeds
    15·2 answers
  • Complete the body of the decrement static method using only the NaturalNumberKernel methods (multiplyBy10, divideBy10, and isZer
    10·1 answer
  • Which of these ia an example of gene flow?
    5·1 answer
  • How do assignment article computer security, ethics and privacy?
    15·1 answer
  • Question 1
    10·1 answer
  • Me inculparon de crear una cuenta en Facebook y colocaron el barrio donde vivo, ¿cómo podría demostrar lo contrario? Ayuda urgen
    6·1 answer
  • You are planning a storage solution for a new Windows server. The server will be used for file and print services and as a datab
    6·1 answer
  • Discuss how a lack of infrastructure in poor communities could contribute to ill-health such as the Unrest looting.​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!