Question: The final part of our program verifies whether the user is our spy or not. (a) Two conditions must be true for the user to
The final part of our program verifies whether the user is our spy or not. (a) Two conditions must be true for the user to be a spy. The first input must exactly equal the string "Banana Bread". The second input must be 'larger' alphabetically than the string "ostrich". Broken down, this means: a. Use equals () to check the first string against "Banana Bread" b. Use compareTo to check the second string against "ostrich". This can be written two ways - check the book or the slides. (b) If the check from part (a) succeeds, print out a message confirming the spy has been validated and that they will soon be debriefed. (c) If the check from part (a) fails, instead make another if-else statement checking the first input against the second with compare to. Have it tell the user which input is larger of the two
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
