Question: 3. Convert the following code so that it uses while loops instead of for loops. public class Loop public static void main(String[] args) { int

 3. Convert the following code so that it uses while loops

3. Convert the following code so that it uses while loops instead of for loops. public class Loop public static void main(String[] args) { int Q, A=356, R, C=323, X=579, D, B--67; for(Q=324;A10;R+-2) { C+B; R++; } D C*B; } } } 4. Write a program that uses a for loop to calculate the sum of the reciprocals of the N amount of numbers. The user will be prompted to enter a number for n. Validate that the number is positive and do not do the calculation until a positive number is received. If the user enters '3" the loop will calculate: 1/1 +1/+% If the user enters '6', the loop will calculate: 1/1 + 2+ 3+ 4+1+% i.e. 1/1 +/+1+14+15+1 .......+1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!