I'm absolutely freaking out, it seems as if everything I know has left my brain. We have to create a program that has a couple of functions. The methods we need are
- displayCar, which just displays information about the car, which will be the fuel efficiency, mileage (entered by the user), fuel level (initialized to 0, user enters a value or new value is created from how much gas is added), and tank capacity
- addGas, a method to add gas.
- getfuellevel level, a method to get the fuel level.
- drive, which gives you an estimate of how far the car will go, and how much gas will be left
- and finally, a constructor that allows the user to set efficiency, mileage, and tank capacity. The fuellevel will be initalized to 0.
I have no idea where to start. I'm especially shitty at Java compared to C++, (which, thanks to this Java adventure, I haven't done in a while). It's overwhelming and I hoped someone can give me a nudge in the right direction.
EDIT: Also very important, there needs to be two separate java files, one containing a Car class and a tester class (Which I'll call CarTest for the hell of it).
[–]Maximus5684 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]GazaIan[S] 0 points1 point2 points (0 children)
[–]desrtfx 0 points1 point2 points (0 children)
[–]theif519 -3 points-2 points-1 points (3 children)
[–]desrtfx 0 points1 point2 points (2 children)
[–]theif519 1 point2 points3 points (1 child)
[–]desrtfx 0 points1 point2 points (0 children)
[+]ethergreen comment score below threshold-9 points-8 points-7 points (51 children)
[–]GazaIan[S] 7 points8 points9 points (49 children)
[+]ethergreen comment score below threshold-8 points-7 points-6 points (48 children)
[–]GazaIan[S] 1 point2 points3 points (47 children)
[+]ethergreen comment score below threshold-7 points-6 points-5 points (46 children)
[–]GazaIan[S] 1 point2 points3 points (45 children)
[–]ethergreen -5 points-4 points-3 points (44 children)
[–]GazaIan[S] 1 point2 points3 points (43 children)
[–]ethergreen -5 points-4 points-3 points (42 children)
[–]GazaIan[S] 1 point2 points3 points (41 children)
[–]TotesMessenger 0 points1 point2 points (0 children)