Question: Consider a program that administers multiple-choice quizzes. The student needs to provide a response such as A or D. Your job will be to check

Consider a program that administers multiple-choice quizzes. The student needs to provide a response such as A or D. Your job will be to check for input errors in the student response string. Check that the string has length 1, and that it is a letter between A and the last valid choice for the problem.

Complete the following file:

public class Inputs { /** Gets the choice that the user provided, or null if the user didn't provide a valid choice. @param input the user input @param maxChoice the maximum valid choice, e.g. "D" if there are four choices. @return the user input if it was a valid choice (i.e. length 1 and between "A" and maxChoice), null otherwise */ public String getChoice(String input, String maxChoice) { // Your work here

} }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!