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
To find information on a network use a ____
igomit [66]

Answer:

circuit

Explanation:

4 0
1 year ago
A shop will give discount of 10% if the cost of purchased quantity is more than 1000. Ask user for quantity suppose, one unit wi
UkoKoshka [18]

Answer:

The program in Python is as follows:

qty = int(input("Quantity: "))

price = 100 * qty

if qty >1000:

    price = (100 - 0.10 * 100) * qty

print("Cost: "+str(price))

Explanation:

This prompts the user for the quantity

qty = int(input("Quantity: "))

This calculates the price or cost, without discount

price = 100 * qty

This checks if the quantity is greater than 1000

if qty >1000:

If yes, this calculates the price or cost, after discount

    price = (100 - 0.10 * 100) * qty

This prints the calculated cost

print("Cost: "+str(price))

4 0
2 years ago
The U.S. consumes lots of energy. Which fuel provides the most energy?
Nadya [2.5K]

Answer:

<em>Natural</em><em> </em><em>Gas</em>

Explanation:

..............

7 0
2 years ago
Read 2 more answers
1. How does the computer take data and information ?​
aniked [119]

Answer:

Data processing, Manipulation of data by a computer. It includes the conversion of raw data to machine-readable form, flow of data through the CPU and memory to output devices, and formatting or transformation of output. Any use of computers to perform defined operations on data can be included under data processing.  Input devices accept data in a form that the computer can use; they then send the data to the processing unit. The processor, more formally known as the central processing unit (CPU), has the electronic circuitry that manipulates input data into the information people want.

Explanation:

6 0
2 years ago
What are two key benefits of using software tools for graphic design?
wel

Hi PaidBeno,

Two key benfits of using software tool like word or powerpoint give you the oppotunity to crate wonderful graphic designs. One example are the shapes and colors to create specific objects. the second benefit is using all the tabs on word that you can use for art to make it look real.

7 0
3 years ago
Other questions:
  • An administrator needs to set up an authentication server for users connecting to a network through a VPN. What kind of server c
    10·1 answer
  • The length of a pencil would most likely be measured in:
    9·2 answers
  • Your organization will be handling market trades. You will be required to verify the identify of each customer who is executing
    8·1 answer
  • Only business writing requires an editing stage
    8·1 answer
  • What can a parent do to help a child adjust to a new culture or area
    7·2 answers
  • Which element in the PowerPoint application is not available in the Microsoft Word application?
    12·2 answers
  • Which of the following is a default letter assigned for the primary hard drive
    6·2 answers
  • Jenny is working on a laptop computer and notices that the computer is not running very fast. She looks and realizes that the la
    14·1 answer
  • Why do we need to make a plan before actions?
    7·1 answer
  • A good information that contains the facts necessary for decision makers to solve a problem is characterized by the __________.
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!