Search:

Type: Posts; User: miss confused

Search: Search took 0.08 seconds.

  1. Replies
    14
    Views
    3,454

    Re: Flaw in my code

    Oh. I got it. Thanks!
  2. Replies
    14
    Views
    3,454

    Re: Flaw in my code

    Feedback:
    The constructor you have written doesn't match the constructor call in the problem specification.

    Output was not:
    My car traveled 400.48 miles on 21.4 gallons of gasoline.
    My mileage...
  3. Replies
    14
    Views
    3,454

    Re: Flaw in my code

    What's wrong with this?



    private double distance;
    private int fuel;

    public AutoTrip(double miles, int gallons){
    distance = miles;
    fuel = gallons;
  4. Replies
    14
    Views
    3,454

    Re: Flaw in my code

    Oh sorry, I forgot to put it in brackets code.
  5. Replies
    14
    Views
    3,454

    Flaw in my code

    Main Method:

    public class Driver
    {
    public static void main(String[] args)
    {
    double distance = 400.48;
    double fuel = 21.4;
    AutoTrip myTrip = new AutoTrip(distance, fuel);
    ...
Results 1 to 5 of 5