Question: Suppose you are writing a program that asks the user to give a yes-or-no response. Assume that the program reads the users response into the
Suppose you are writing a program that asks the user to give a yes-or-no response. Assume that the program reads the user’s response into the Stringvariableresponse.
a. If response is yes or y, set the boolean variable accept to true; otherwise, set it to false.
b. How would you change the code so that it will also accept Yes and Y?
Step by Step Solution
3.53 Rating (167 Votes )
There are 3 Steps involved in it
a if responseequalsy responseequalsyes accept true else accept false ... View full answer
Get step-by-step solutions from verified subject matter experts
