Question: 2. (3 points) Consider the following method: public static void countDown(int n) { for (int count = n; count >= 1; count--) { System.out.println(count); }

2. (3 points) Consider the following method: public static void countDown(int n) { for (int count = n; count >= 1; count--) { System.out.println(count); } } When the input n is a positive integer, this method "counts down" from n, printing the integers from n down to 1. For example, countDown(5) would print 5 4 3 2 1 If n is less than or equal to 0, the method does not print anything. We have included the original method in ps1_partI. Rewrite it so that it uses a while loop instead of a for loop
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
