Auto-graded

    024 - For Loop 6 (optional)

    024 - For Loop 6 (optional)

    Using a for loop, determine whether the integer variable max is prime or not. If the number is prime, print out "prime". If it's not, print out "not prime". Keep in mind that 1 is NOT a prime number. You can use the following to find the square root of a number (you may or may not use this): Math.sqrt(num) Sample input/outputs: In: 100 out: not prime In: 17 out: prime In: 9 out: not prime In: 1 ..

    015 - Conditional Statement Practice 1

    015 - Conditional Statement Practice 1

    The variable "num" holds an integer user input Write a conditional statement starting on line 9 that does the following: If num is positive, print "__ is positive" If num is negative, print "__ is negative" Examples: In: 5 5 is positive In: -2 -2 is negative In: 0 (no output for zero) import java.util.*; class Main { public static void main(String[] args) { Scanner inp = new Scanner(System.in); ..