i was tasked with writing a program that prints the question ”Do you want to continue?” and reads a
user input. If the user input is ”Y”, ”Yes”, ”OK”, ”Sure”, or ”Why not?”, print out ”OK”. If
the user input is ”N” or ”No”, then print out ”Terminating”. Otherwise, print ”Bad input”.
The case of the user input should not matter. For example, ”y” or ”yes” are also valid
inputs.
Write a class YesNoChecker for this purpose
i made a class continue
import java. util.Scanner;
public class Continue
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
System.out.println("Do you want to continue?");
String input = in.nextLine();
YesNoChecker c = new YesNoChecker(input);
if(c.isYes())
System.out.println("OK");
else if (c.isNo())
System.out.println("Terminating");
else
System.out.println("Bad Input") ;
}
}
now comes the problem im facing i dont know how to get started on the methods .isYes and .isNo please be kind enough to give me some guidance thank you
public class YesNoChecker {
public void YesnoChecker(String a){
}
public String isYes(){
}
public String isNo(){
}