Bear Bibeault wrote:P.S. I noticed you've fallen into the habit of not assigning access modifiers (public, private) to your declarations. Any reason why?
Scott Winterbourne wrote:Hi David,
If I were you I'd write one method to determine if the car is a gas hog or economy. Write an If Else statement in the method and return a boolean or some other type that you can output in the main method. Or have a println() right in the new method.
Hope this helps.
Scott Winterbourne wrote:If you only need to output the text if it's a gas hog or economy car then you can change the return type of each method to "void". then you don't have to supply a return statement.
If you do need to return a boolean then you will need to declare a boolean variable inside the methods, set it to true or false, and then return that.
Scott Winterbourne wrote:You'll need to call these two methods from your main() method.
Consider Paul's rocket mass heater. |