-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MethodSwitch 1 #2
base: master
Are you sure you want to change the base?
Conversation
First publish of the MethodSwitch program.
The only thing I noticed, is you forgot to do the comments on your functions by using the /** "enter" that he showed in class this week. |
Added comments to the MethodSwitch program.
Thanks Steven. Got carried away with formatting what became some pretty sloppy code and forgot all about comments. |
System.out.println("Enter '1' to play FIZZBUZZ.\n" + "Enter '2' to view the value of your chosen word.\n" + "Enter '3' to use the salary calculator.\n" | ||
+ "Enter '4' to check your grade.\n" + "Enter '5' to play Truth or Dare.\n" + "Enter '6' or any other number to EXIT."); | ||
number = keyboard.nextInt(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If each menu item were on a separate line, it would make reading and editing it much easier.
Nice program, neat and easy to read (except where noted). |
Changed formatting in the MethodSwitch program to make menu items easier to read.
System.out.println("Enter 'Truth' or 'Dare':"); | ||
response = keyboard.next(); | ||
|
||
if (response.equalsIgnoreCase("TRUTH")){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These truth or dare literals are perfect opportunities to use constants within your function.
final String TRUTH = "truth";
final String DARE = "dare";
if(response.equalsIgnoreCase(TRUTH)){}
if(response.equalsIgnoreCase(DARE)){}
No requirement to make this change just a way of thinking about it. I felt this "TRUTH"
variable was almost screaming out like you wanted it to be a constant 👍
First publish of the MethodSwitch program.