Posts

Showing posts from May, 2021

Guess The Number Game In Java

Image
Subscribe to CODE.CIRCLE CODE:   package com.company ; import java.util.Random ; import java.util.Scanner ; class Game { int computer ; public Game (){ Random rand = new Random (); computer = rand . nextInt ( 100 ); System . out . println ( "Guess the Number Form 1 to 100" ); } public int computerNo (){ return computer ; } } public class CWH_43_EX3 { static int takeUserInput (){ int user ; System . out . println ( "Enter " ); Scanner sc = new Scanner ( System . in ); user = sc . nextInt (); return user ; } static void isCorrectNumber ( int i , int j ){ if ( i == j ){ System . out . println ( "Correct NO. Guess" ); } else if ( i > j ){ System . out . println ( "Your No. is Big than computer No." ); } else { System . out . println ( "Your No. is Small than comput...