Purchase Solution

While loops versus for loops

Not what you're looking for?

Ask Custom Question

1. Explain when you would use a while loop rather than a for loop and vice versa. Provide an example of one such instance.

2. How are looping statements different from selection statements?

Purchase this Solution

Solution Summary

This solution explains when it is best to use a while loop versus a for loop. It also explains the difference between a loop and a selection statement.

Solution Preview

A while loop is intended to run until a particular condition occurs. It is usually not known how many iterations it will take for that condition to be met. A for loop, on the other hand, is usually set to run a known number of times. These are just general rules of thumb that lead to cleaner and ...

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Javscript Basics

Quiz on basics of javascript programming language.