Hey guys. I am getting a fair amount of errors when trying to create this menu. I am not sure whether or not I am going about it correctly.
Without further adieu:
package assignment.pkg2;
import java.util.Scanner;
public class Assignment2 {
public static final int MAX_NUM = 10;
public static void main(String[] args) {
ElementSet set = new ElementSet();
Scanner keyboard = new Scanner(System.in);
int menuChoice;
Subscriber subList[] = new Subscriber [MAX_NUM];
for(int i = 0; i < MAX_NUM ;i++)
{
subList[i] = new Subscriber("", "", 0);
}
static int getNumber(String message)
{
Scanner keyboard = new Scanner(System.in);
return keyboard.nextInt();
}
static int getMenuChoice()
{
String message = "Here are your Choices: \n"
+ "Enter 1 to add a Subscriber \n"
+ "Enter 2 to add an Application \n"
+ "Enter 3 to flag a Subscriber \n"
+ "Enter 4 to flag an Application \n"
+ "Enter 5 to unflag a Subscriber \n"
+ "Enter 6 to unflag and Application \n"
+ "Enter 7 to display all Subscribers \n"
+ "Enter 8 to display all Applications \n"
+ "Enter 9 to Quit \n";
return getNumber(message);
}
menuChoice = getMenuChoice();
while(menuChoice != 9)
{
switch(menuChoice)
{
case 1:
//add subscriber to Element Set array
break;
case 2:
//add application to Element Set array
break;
case 3:
//flag a specified subscriber
break;
case 4:
//flag a specified application
break;
case 5:
//unflag a specified subscriber
break;
case 6:
//unflag a specified application
break;
case 7:
//display all subscribers in the Element Set array
break;
case 8:
//display all applications in the Element Set array
break;
}
menuChoice = getMenuChoice();
}
}
ERRORS:
Line 22: reached end of file while parsing
Line 24: Illegal start of expression
Line 46: Cannot find symbol 'class menuChoice()'
Line 48: Cannot find symbol 'class menuChoice()'
Line 50: Cannot find symbol 'variable menuChoice()'
Line 87: Cannot find symbol 'variable menuChoice()'
I don't exactly understand why this is happening. Any ideas?