Completed:
Percentages
4. a. Create an application named Percentages whose main() method holds two double variables. Assign values
 to the variables. Pass both 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% of 5.0.” Then call the method a second time,
 passing the values in reverse order. Save the application as Percentages.java.

 Percentages2
 b. Modify the Percentages class to accept the values of the two doubles from a user at the keyboard. Save the
  file as Percentages2.java.

  GasPrices
 5. When gasoline is $100 per barrel, then the consumer’s price at the pump is between $3.50and $4.00 per
 gallon. Create a class named GasPrices. Its main() method holds an integer variable named pricePerBarrel to
 which you will assign a value entered by a user at the keyboard. Create a method to which you pass
 pricePerBarrel. The method displays the range of possible prices per gallon. For example, if gas is $120 per
 barrel, then the price at the pump should be between $4.20 and $4.80. Save the application as GasPrices.java.

 MetricConversion
6. There are 2.54 centimeters in an inch, and there are 3.7854 liters in a U.S. gallon. Create a class named
MetricConversion. It’s main() method accepts an integer value from a user at the keyboard, and in turn passes
the entered value to two methods. One converts the value from inches to centimeters and the other converts the
same value from gallons to liters. Each method displays the results with appropriate explanation. Save the
application as MetricConversion.java.