|
well pringle, there's a few things:
tim meant that, do you want your program to be a graphical user interface, meaning that should it have a window that pops up where you choose things by clicking on buttons and stuff like that, or do you want it to be completely text-driven (seen through the console, using Scanner and System.out.println in order to input and ouput). I personally think that you should just make it non-graphical, because making it graphical is a whole different topic, which is alot more advanced (you gotta learn about events, buttons, etc.). So, for now, lets get this working by using the console, and then, we'll try to make it graphical (you're teacher will be impressed =]).
also, keep in mind that switch statements can not run on Strings, as you did in your previous post:
"Case initialise:"
it would have to be : case 1 ... or case 2
switch statements can only rely on primitive types (i'm not completely positive if it can run on longs, shorts, doubles, and floats, but i know for a fact that it can work with ints, bytes, and chars).
What this all means is that, you could never have the following example:
---------------------------------------------
Scanner in = new Scanner(System.in);
System.out.print("Please enter your name");
String name = in.nextLine();
switch(name)
{
case Nick:
System.out.println("Hey Nick!");
break;
case John;
System.out.println("Hey John!");
break;
}
------------------------------------------------
This would yield a compile-time error.
|