Skip to main content

Posts

Showing posts from July, 2018

simple Guessing Game in JAVA

package javaguessinggame1; import java.util.*; /**  *@title Guessing  Program  * @author Herdy  */ public class JavaGuessingGame1  { //random number declaration      static Random r= new Random();     static Scanner i = new Scanner(System.in);     public static void main(String[] args)     {   //setting the variable round to 0         int round=0;         do {  //add one to variable round while it is less than 3             round++;             System. out .println( "Round: " +round); //setting the variable com and guess to choose a random number from 0-1 only                   double com=Math.floor(Math.random()*2),                guess=Math.floor(Math.random()*2);       ...