Question 0-3

Fill in run() so that the method will print ``Hello'' to the screen 2,001 times.

import csbsju.cs160.*;

public class PrintHello {
    public static void run() {





    }
}

Solution

import csbsju.cs160.*;

public class PrintHello {
    public static void run() {
        int i = 0;
        while(i < 2001) {
            IO.println("Hello");
            i++;
        }
    }
}

Back to Review for Quiz 0