Discuss a situation in which it would be more appropriate to use a do…while statement than a while statement. Explain why.

What will be an ideal response?

A do…while statement executes its body zero or more times, so if you want to guarantee that the loop body executes at least once, you’d choose a do…while statement over a while statement.

Computer Science & Information Technology

You might also like to view...

A(n) ____________ specifies how a class member can be accessed by code located outside the class.

a. variable name b. access modifier c. namespace d. class name

Computer Science & Information Technology

A(n) ________ chip converts sound waves from a voice into a digital signal.

A. analog-to-digital converter B. digital convergence C. digital signal processor D. telephony

Computer Science & Information Technology