ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 9 Weeks Ago, 4 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 29 May 2017 My Price 8.00

Create a class name GasPrices

I am struggling to finish the problem can someone please help

Purpose: Create a class name 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

*/

import java.util.*;

public class GasPrices
{
public double perbarrel = 120;
public double pergallon_low = 4.20;
public double pergallon_high = 4.80;

public static void main (int pricePerBarrel)
{
Scanner s = new Scanner ( System.in );
System.out.print ( "pricePerBarrel : " );
double pricePerBarrel = s.nextDouble ();
System.out.printf
( 
"pricePerGallon : %.2f to %.2fn",
getBecomes2 ( 120, 4.20, pricePerBarrel );
getBecomes2 ( 120, 4.80, pricePerBarrel );
)
}
}

Answers

(11)
Status NEW Posted 29 May 2017 12:05 AM My Price 8.00

-----------

Not Rated(0)