Game playing with number with computer in java
package com.company ; import java.util.Scanner ; import java.util.Random ; class Game { int number ; int Inputnumber ; int NumberofGuesses = 0 ; public int getNumberofGuesses () { return NumberofGuesses ; } public void setNumberofGuesses ( int numberofGuesses ) { this . NumberofGuesses = numberofGuesses ; } Game () { Random rn = new Random (); this . number = rn . nextInt ( 100 ); } void takeUserInput () { System . out . println ( "enter your choice" ); Scanner sc = new Scanner ( System . in ); Inputnumber = sc . nextInt (); } boolean isCorrectNumber () { NumberofGuesses ++; if ( Inputnumber == number ) { System . out . format ( "yes you guessed it right, it was %d \n you get it in %d attempts " , number , NumberofGuesses ); return true ; } else if ( Inputnumber < number ) { System . out . p