Part 1

public class Guessing {
    static int b = randomNumber();
    static boolean gameRunning = true;
    public static int randomNumber() {
        
        double a = (1 + Math.random() * 100);
        return ((int) Math.floor(a));
    }
   
    public static void newNumber(){
        b = randomNumber();
    }

    public static String guessing(String guess) {
        int c = Integer.valueOf(guess);
        
        if (c != b) {
            if (c > b) {
                return (c + " was not the number," + "\nlower\n");
            }
            if (c < b) {
                return ( c + " was not the number," + "\nhigher\n");
            }
                
        }

        if (c == b) {
            gameRunning = false;
            return "You guessed it! The number was " + b;
        }

        return "error";
   }
}

public class Main{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        while(Guessing.gameRunning){
            System.out.println("Type Guess Here: ");
            String input = scanner.nextLine();
            System.out.println(Guessing.guessing(input));
        }
    }
}

Main.main(null);
Type Guess Here: 
50 was not the number,
higher

Type Guess Here: 
75 was not the number,
higher

Type Guess Here: 
90 was not the number,
higher

Type Guess Here: 
92 was not the number,
higher

Type Guess Here: 
You guessed it! The number was 94

Part 2

iteration quiz