ask for the volume of the tank of gas (tankSize) ask for the price of gas (pricePerGallon) cost = tankSize * pricePerGallon + tankSize * TAX_PER_GALLON print the cost
ask for the number of cones sold (conesSold) ozSold = cones * OZ_PER_CONE gallonsSold = ozSold / OZ_PER_GALLON print gallons sold
gallonsPerTank
[public private] [static] type identifier [= value] [, identifier = value] ;
public static void main(String[] args) { int numberOfCones = 123; float pricePerGallon = 3.45f; char letter = 'z'; boolean isFinished = false; int x,y; int day = 1, month = 2, year = 2025; double bigNumber = 1.65E23; long largeNumber = 1_000_000_000L; long largerNumber = 2000000000L;
public static final type identifier = value
class VariablesDemo{ public static final int OZ_PER_CONE = 8; public static final float TAX_PER_GALLON = 0.576f; ... }