Question: a) Trace the given FOR loop using trace table and write the values of variables rate and frequency after completing tracing. int rate 45;

a) Trace the given FOR loop using trace table and write the

 values of variables rate and frequency after completing tracing. int rate 45; 

a) Trace the given FOR loop using trace table and write the values of variables rate and frequency after completing tracing. int rate 45; int frequency = 2; for (int i = 7; i >= 1; i--) { rate == 2; frequency = (rate*2)+1; } Iteration/Step Value of i i>1 rate 2 frequency = (rate*2)+1 |-- b) Trace the given DO-WHILE loop using trace table and write the values of variables totalHours and totalPay after completing tracing. int pay = 50; double days = 0; int hours 5; int totalHours = 0; int totalPay = 0; do{ totalHours += hours; totalPay + pay * hours; days += 1.5; while (days < 6); Iteration/Step total Hours += hours totalPay += pay * hours days += 1.5 days < 6 c) Trace the given WHILE loop using trace table and write the values of variables word and code after completing tracing. String word = "A"; int count = 10; int code 85; while(count != 0) { word code -= 4; (char) code; count -= 2; } Iteration/Step count != 0 word += (char) code code -= 4 count -=2

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 Programming Questions!