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
Georgia [21]
3 years ago
14

Create an application named Percentages whose main() method holds two double variables. Assign values to the variables. Pass bot

h variables to a method named computePercent() that displays the two values and the value of the first number as a percentage of the second one. For example, if the numbers are 2.0 and 5.0, the method should display a statement similar to "2.0 is 40 percent of 5.0." Then call the method a second time, passing the values in reverse order.
Computers and Technology
1 answer:
lbvjy [14]3 years ago
8 0

Answer:

The codes below implement the problem statements

Explanation:

public class Percentages {

public static void computePercent (int a,int b)

{

System.out.println(a+" is "+(a*100/b)+"% of "+b);    

}

 

public static void main(String []args)

{

int a=2;

int b=5;

computePercent(a,b);

computePercent(b,a);

}

}

<u> </u>

<u>Part(b) </u>

import java.util.*;

public class Percentages {

public static void computePercent (int a,int b)

{

System.out.println(a+" is "+(a*100/b)+"% of "+b);

}

 

public static void main(String []args)

{

Scanner s= new Scanner(System.in);

int a=s.nextInt();

int b=s.nextInt();

computePercent(a,b);

computePercent(b,a);

}

}

You might be interested in
Allan needs to ensure that an object is in a very precise location on a slide. He decides to use the Ruler option to achieve thi
shusha [124]

Answer:

It can be found on View tab.

Explanation:

The view tab on Microsoft Power point is the 9th tab when counting from the left. When clicked, the view tab displays a number of tools that are aimed at visualizing how slides appear.

The ruler function is one of those tools. It is used to ensure that an object is placed or appears at a specific location in the slides. The ruler tool can be found in the Show Box which is the third box from left after Presentation View and Master View.

8 0
3 years ago
Read 2 more answers
What information on social networking sites could be used to discriminate against a potential employee
NISA [10]

the answer on plato is b

political affiliations

3 0
2 years ago
Does nest cam outdoor connect to a security camera prewire
yawa3891 [41]
Answer: hi there! Have a good day/night :))
6 0
2 years ago
How does a typewriter involve math and science?
patriot [66]
You have a specific number of words typed a minute and you need to know the science involved in making it
8 0
2 years ago
Read 2 more answers
Distinguish<br> between formal and Informal<br> Information System<br> Information systems
Harlamova29_29 [7]

Explanation:

Formal; A formal information system is based on

the organization represented by the organization chart.

Informal; The informal information system is

employee based system designed

to meet personal and vocational needs

and to help in solution of work-related problems.

5 0
2 years ago
Other questions:
  • Given main(), define the Team class (in file Team.java). For class method getWinPercentage(), the formula is:teamWins / (teamWin
    15·1 answer
  • 3. Discuss the disadvantages of file-based systems.
    13·1 answer
  • William found out that someone used his report on American culture without his permission. What is William a victim of?
    13·2 answers
  • Which of the following is true about images that are arranged in a collumn
    9·1 answer
  • Why is it important to protect people's intellectual property online?
    10·1 answer
  • Which of these would NOT be a valid Internet Control Message Protocol (ICMP) error message:
    6·1 answer
  • Eliza needs to share contact information with another user, but she wants to include only certain information in the contact. Wh
    9·2 answers
  • Using the drop-down menu, complete these sentences to describe algorithms. Algorithms are instructions to solve a problem. Algor
    12·2 answers
  • HELP FAST
    14·1 answer
  • Your principal has hired you to design a drone that can monitor students in the hallways. Before you brainstorm design ideas, yo
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!