Final answer:
Using a while loop ensures that the user inputs a positive integer for the variable amount. A for loop is written to print the multiples of 3 from 300 down to 3, each on a new line.
Step-by-step explanation:
To ensure the user enters a positive integer number for amount, a while loop is used. The loop continues to prompt the user until they enter a positive integer:
int amount;
System.out.print ("Enter a positive integer: ");
amount = scan.nextInt();
while (amount <= 0) {
System.out.print("Please enter a positive integer: ");
amount = scan.nextInt();
}
For printing the multiples of 3 from 300 down to 3, a for loop can be used:
for (int i = 300; i >= 3; i -= 3) {
System.out.println(i);
}