(no subject)

Sep 28, 2006 08:23

I CANT GET THIS TO RUN RIGHT
stupid java

// Elizabeth Bosch
// AP Computer Science
// Date: September 25,2006
// Description:
//
import java.util.*;

public class Program3_11b
{
    public static void main(String[] args)
    {
        int count = 0;
        int secret = 0;
        int guess = 0;
        boolean gameOver;
        String response = "y";

Scanner scan = new Scanner(System.in);
        Random generator = new Random();

while (response.equals("y"))
        {
            count = 0;
            secret = generator.nextInt(100) + 1;

gameOver = false;

while (!gameOver)
            {
                System.out.print("Guess a number between 1 and 100:");

guess = scan.nextInt();

if (guess > secret)
                {
                    System.out.println("Guess is too high.");
                }

else if (guess < secret)
                {
                    System.out.println("Guess is too low.");
                }

else if (guess == secret)
                {
                    System.out.println("Guess is correct.");
                    gameOver = true;
                }
                count++;
                System.out.println("Would you like to continue? (y/n)");
                response = scan.next();

if (response.equals("n"))
                {
                    gameOver = true;
                }
                else if (response.equals("y"))
                {
                    gameOver = false;
                }

gameOver = true;
                System.out.println("Game Over");

}
        }
    }
}

it is suppose tp run a game where u guess the number and it tells u if it is high or low or correct i got that far but i cant get the game to end or tell the number of guess i made or tell the secret number if i wish to exit
so yea but there is not teacher here today mr ben is gone idk where ut yea so now we dont have the answer to the thingy up there grrnes si was really workin hard i came the closest as he said ther then the one girl who got it the day before but yea so hmmm
what else i told u i would update on stuff but yea so lets see we lost our home game
JV got 25 to 10 the 1st game the 25 to 4!!!!!! ftw that was the gayest game ever and they werent even that good it was just us messin up on startin and junk really sucked my parents and art came to see it they still r all like im the best and junk but yea so fun fun fun
also i was  moved up to cap. on jv it was kool that a girl yesteray befre the game was lke o u should be captain
and i was like no1 knew they moved me up so no1 would be mad at me before thegame but it was a varsity girl it is was nice of her to say so she thinks i am pretty good for jv so yea xD
its fun but yea it is makin me miss alot of math and english i went to some of math befroe my game yesterday but still i am FAILing english this is cuz he said he couldnt read my handwritin to i do all of my work so that really sucks but yea he wants me to type my 10 front and back pages of work thhat it took me forveer to write ><;
well i am workin on it as for tha i dont think there is much else to say i am ok i am alive still workin hard and tryin to get up on stuff but yea so all yall take care and ttyl muah byez <3

what does this button do....!!!!!!.....i

Previous post Next post
Up