import java.util.Scanner;

public class Checker 
{
    public static void main(String[] args) 
    {
        int number;  
	
        // Create a Scanner object for keyboard input.  
        Scanner keyboard = new Scanner(System.in);  
             
        // Get a number from the user.  
        System.out.print("Enter a number in the range of 1 through 100: ");  
        number = keyboard.nextInt();  

        while (number<1 || number >100)
        {  
           System.out.print("Invalid input. Enter a number in the range " +  
                            "of 1 through 100: ");  
           number = keyboard.nextInt();  
        } 
    }
}
public class LoopConversion 
{
    public static void main(String[] args) 
    {

        //convert to for loop
        for  (int count=0; count < 5; count++)
        {
            System.out.println("count is " + count);
        }
    }
}
for (int i=0; i<5; i++){

    System.out.println(i);



    int i<5}
0
1
2
3
4
int i = 0;

while (i < 5){
    System.out.println(i);
    i = i+1;
}
0
1
2
3
4

Random Number Guesser

import java.util.Scanner;
import java.lang.Math;
 
Scanner number = new Scanner(System.in); 
float number_float = Integer.parseInt(number.nextLine());  // read user input
System.out.println(number_float);

double random = Math.random() * 10;
//int random_int = float.parseInt(random.nextLine());
System.out.println(random);

public class Number{
    public static void main(String[] args){

        while (number_float != random){

            if (number_float < random){
                System.out.println("too low, try again");
                Scanner number = new Scanner(System.in); 
                float number_float = Integer.parseInt(number.nextLine());  // read user input
                System.out.println(number_float);
            }

            if (number_float > random){
                System.out.println("too high, try again");
                Scanner number = new Scanner(System.in); 
                float number_float = Integer.parseInt(number.nextLine());  // read user input
                System.out.println(number_float);
            }
            
           
    }

    System.out.println("congrats, you got it");
    



    }

}
Number.main(null);
10.0
7.135002924452982
too high, try again
8.0
too high, try again
---------------------------------------------------------------------------
java.lang.NumberFormatException: For input string: ""
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.base/java.lang.Integer.parseInt(Integer.java:662)
	at java.base/java.lang.Integer.parseInt(Integer.java:770)
	at Number.main(#30:1)
	at .(#58:1)