- ID: ***7014      Grade: 4/10
- toString(): the method should be declared as public String toString() instead of public void toString1().
You covered printing out some special cases (like ace of spades). You should write the method such that it prints out value and suit
(if value = 2 and suit = 'D' the it should print out "The 2 of diamonds").
- It would be nice if you put a comment before each method describing what that method does, what the inputs are and what the method returns.
- Please make sure that next time you separate methods by a blank line which will improve readability a lot
- ID: ***5656      Grade: 10/10
- Good program.
- MilesPerGallon: nice code, nice testing, great summary. Though I would like to see decoupled input and output
(first to enter the readings, then to calculate the mpg) it is not important as the program is excellent.
- Card: pretty good code. You could use Character.toUpperCase() method to convert lower case letter to upper case one.
- ID: ***4684      Grade: 8/10
- Mpg: most of the code is good but you need to pay attention to details.
- public static int odometer(int m, Scanner console): you do not need to pass m as you use it as a local variable in odometer().
You could declare it inside the method instead. Similar logic stands for gas() method.
- You should start indexing an array from 0 not from 1 (miles, miles,...).
- You stopped taking inputs when distance was negative instead when negative value for miles was entered.
Please try to follow instructions next time.
- Card: the constructor takes value and suit and sets this.value to value and this.suit to suit if value and suit are valid.
So, you need to check if value is in between 1 and 13 and if it is to set this.value = value, that's it.
I do not understand the purpose of array v.
- You converted lower case to upper case, but you need to assign upper case letter to this.suit not suit.
Also, you still need to check if suit is valid meaning if it is 'C', 'D', 'H', or 'S'. If it is not, then you should print out an error
message and exist the program.
- sString(), isClub(), etc.: make sure that you compare to upper case letters not to lower case ones.