No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
I have some code which examines an array to see if it contains a particular value: boolean found = false; int []a = new int[100]; populate(a); // populates the array a with a set of random values int valueToFind = 123; // or whatever we want to find while((n < … |
|
Could anyone give me a hand with my mock exam, i'm on msn - [email]get_jiggy_widit@hotmail.com[/email]. I'm struggling a bit - with some of the simple things really n it's getting on my nerves. Any help would be greatly received. Thanks Steve |
|
code: public static void menu(){ String reply; System.out.println("Make your choice:"); reply = getLineFromUser(); //assume this function works correctly if(reply.equals("play")){ playgame(); } else if(reply.equals("end")){ stopGame(); } menu(); // recursive call. Don't use!!!!! Any ideas? i struggle with while loops at the best of times. |
|
I've come up with some code to try and reject ages outside the range of 18 to 64, but i cant seem to find my errors or how to fix it. Feel stupid as its probably somethin easy, but i'm just learnin the language, can you help: int age; age … |
|
here's the code: string reply; reply = getLineFromUser(); //assume this function works correctly if(reply == "JAVA"){ System.out.println("OK to continue"); } else { System.out.println("Error - try again!"); } i cant seem to see where i'm going wrong, thus cant get a correct version to work. I need it to keep repeating … |