import java.util.Scanner; import javax.swing.JOptionPane; import java.util.Random; public class Lab5 { public static void main(String[] args) { /* 1a - True * 1b - False * 1c - True * 1d - False * 1e - False * 1f - False */ //2a for(int i=0; i<=1000; i+=10){ System.out.println(i); } //2b int c = 0; while (c<=1000){ System.out.println(c); c+=10; } //2c for (int i=0; i<5; i++){ for (int j=0; j<5; j++){ if (i!=j) System.out.print("#"); if (i==j) System.out.print("_"); if (j==4) System.out.println(""); } } //2d Scanner two = new Scanner(System.in); int tw=1; int sum2=0; do{ System.out.println("Input a number, or 0 if you want to be done"); tw = two.nextInt(); sum2=sum2+tw; System.out.println("Sum is "+sum2); } while(tw!=0); // 2e int x,y; String zeroes =""; for(x=0, y=0; x<5; x++, y+=2){ zeroes=x+zeroes+y; System.out.println(zeroes); } //2f Random generator = new Random(); System.out.println("How many random numbers do you want?"); int a = two.nextInt(); System.out.println("What should the upper bound be?"); int b = two.nextInt(); c=0; while(c9){ input = JOptionPane.showInputDialog("Number must be at least " + 1 + " and no more than " + 9 + ". Try again:"); n = Integer.parseInt(input); } factorial = 1; for (int j=1; j