reset password
Author Message
Anonymous
Posts: 166
Posted 13:36 Oct 20, 2013 |

import java.util.Scanner;

public class CarInputTester
{
    public static void main(String[] args)
    {
        CarInput car = new CarInput();
        car.addGas();
        Scanner in = new Scanner(System.in);
        System.out.print("How many Gallons are you adding? ");
        int gallon = in.nextInt(); 

       System.out.println(car.milesperTank());

    }
}

for my addGas method I use 

public void addGas(double gallon)
    {
        gasInTank = (gasInTank + gallon);
    } 

so i want the user to input gallon but it doesnt return what i input

 

       
       
       
             
        
        
        
    

Anonymous
Posts: 166
Posted 14:19 Oct 20, 2013 |

Get rid of carInput = new Car input();

 

Last edited by Anonymous at 14:20 Oct 20, 2013.