Assignemnt #58 One Shot HiLo

Code

    ///Name: Morgan Kaplan
    ///Period: 5
    ///Project Name: One Shot HiLo
    ///File Name: HiLo.java

import java.util.Random;

import java.util.Scanner;

public class HiLo
{
    public static void main( String[] args )
    {
        Scanner momo= new Scanner(System.in);
            
        Random r =new Random();
        int choice=1+ r.nextInt(100), guess;
        
        System.out.println ( " Guess a number between 1-100?" );
        guess=momo.nextInt();
            
        if ( guess==choice )
		{
			System.out.println( " wow youre right." );
            }
       else if ( guess > choice) 
		{
			System.out.println( "Sorry you were to high. It was " + choice + "." );
            }
        else if ( guess < choice) 
		{
			System.out.println( "Sorry you were to low. It was " + choice + "." );
            }
    
    }
}
    

Picture of Output

Assignment 58