Hey everyone,
New to Java and i was hoping if anyone could assist me.I needed to write a program that could display results of Champions League initial menu screen with the following set of options:
1. Display the current score for each possible response.
2. Vote
3. Quit the program.
import javax.swing.JOptionPane;
02 import java.util.Scanner;
03
04 public class ChampionLeague {
05 public static void main(String args[]){
06
07 int choice;
08 int Quit = 0;
09 String optionselected;
10
11 String outputString = " ";
12
13 outputString = JOptionPane.showInputDialog(" Who will win the Champions League in 2010/11? "
14 + "\n 1. Real Madrid"
15 + "\n 2. Barcelona"
16 + "\n 3. Chelsea"
17 + "\n 4. Manchester United");
18
19 choice = lnterger.parselnt(outputString);
20
21
22 for(int i = 0; i <4; i++){
23
24 switch(choice ){
25
26
27 case 1: optionselected = "Real Madrid";
28 break;
29
30 case 2: optionselected = "Barcelona";
31 break;
32
33 case 3: optionselected = "Chelsea";
34 break;
35
36 case 4: optionselected = "Manchester United";
37 break;
38
39 default: optionselected = "Invalid number";
40
41 }//end of switch
42 }// end of for
43
44
45
46 }
}
47
Exception in thread "main" java.lang.UnsupportedOperationException: Not yet implemented
at lnterger.parselnt(lnterger.java:13)
at ChampionLeague.main(ChampionLeague.java:30)
I know i might have messed up somewhere but please understand that am new and trying to learn and any response will be highly appreciated..tips of good books for coding?
please advice
thanks
48
49