import java.util.*; public class LogicAssignment { public static void main(String[] args) { int num = (int)(Math.random()*3) - 1; System.out.println("num = " + num); //Don't worry about how you get a value for num, //just fill in the line below knowing that you have //a random variable: num. /*1*/ boolean numIsPositive = //you want this to be true when a is bigger than zero, and not equal to zero. if(numIsPositive) System.out.println("num is positive."); else if (num == 0) System.out.println("num is zero."); else System.out.println("num is negetive"); boolean trueOrFalse = Math.random() > .5; System.out.println("\ntrueOrFalse = " + trueOrFalse); //Write and if satement to print out "T" if the //variable trueOrFalse is true, or "F" if the variable //is false. /*2*/ int a = (int)(Math.random()*10); int b = a+(int)(Math.random()*100); System.out.println("\na = " + a); System.out.println("b = " + b + "\n"); //Again, dont worry about how the values of a and b //are assigned, just write a while loop to count from zero to a, //using the counting variable count1, and print the numbers //to the screen. //Example: // if a is 5, the program should print out- // 0 // 1 // 2 // 3 // 4 // -and it should not print out 5. /*3*/ int count1 = 0; System.out.println("--a reached"); //Now write a for loop to count from a to b //using the counting variable count2. //Example: // if a is 5 and b is 10, the program should print out- // 5 // 6 // 7 // 8 // 9 // 10 // -and should stop after it has printed out b (10). /*4*/ for(int count2 = a; int c = (int)(Math.random()*10); System.out.println("\nc = " + c); //Write a do-while loop to count up from c to 5 //or to print out c if it is more than or equal to 5. //Example: // if c is 2 print out: // 2 // 3 // 4 // and not 5. // // or, if c is 8 print out: // 8 // and then stop. /*5*/ } }