public static void seven(){}
public static String reverseIt(String a){
System.out.print("Enter string:");
int length=a.length();
StringBuilder reverse=new StringBuilder();
for(int i=length; i>0;--i){
char result=a.charAt(i-1);
reverse.append(result);
}
return reverse.toString();
}
public static void eight(){}
public static void nine(){}
public static void ten(){}
public static void eleven(){}
public static void twelve(){}
public static void main(String[] args) {
Scanner kbd = new Scanner(System.in);
int x = 0;
boolean myFlag = true;
while(myFlag){
System.out.println("Enter -1 to quit\n or enter question number");
x = kbd.nextInt();
switch(x){
case 1:
one();
break;
case 2:
two();
break;
case 3:
three();
break;
case 7:
seven();
case 11:
eleven();
break;
case -1:
myFlag = false;
default:
System.out.println("Enter -1 to quit\n or enter question number");
}
}
}
}
This is the output, I'm not really sure how this is suppose to work so maybe thats my issue.
Enter -1 to quit
or enter question number
7
Enter -1 to quit
or enter question number

New Topic/Question
Reply



MultiQuote





|