Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

java programming

qq
qq 


see spec Attachments Tags Clarifications

Answers

GuessingGame

sudheer488
sudheer488 



find the program along with output screenshots Attachments
SingleGame Output.PNG (16 K) Download Preview

GuessingGame.java (6 K) Download Preview
//if statements if (num == 0) { //when user types '0' it ends the program System.exit(0); System.out.println("You gave up!.... Reseting program..."); } else if (num > rnd) { //prints too big, adds to counter 'guess' System.out.println("The number is too big!");

multiplegames1.PNG (20 K) Download Preview

Screenshots
Screenshot
Screenshot
Purchase Answer

Programming Assignment #5: Guessing Game

felo
felo 



This program plays a guessing game with the user, generating a random number that they must guess
//The user may play again until they type no, in which case, the program will print the results of
//the game
Attachments
GuessingGame.zip (4 K) Download




Preview
"..."); int guesses = 0; int actualNum = rand.nextInt(MAX) + 1; int userGuess = 0; while(userGuess != actualNum){ System.out.print("Your guess? "); userGuess = console.nextInt(); if(userGuess < actualNum){ System.out.println("It's higher"); }else if(userGuess > actualNum){ System.out.println("It's lower"); } guesses++;

guess.png (109 K) Download Preview

Screenshots
Screenshot
Purchase Answer