Purchase Solution

Looping and Case Statements

Not what you're looking for?

Ask Custom Question

1. When using Case statements, what would happen if you did not "Break?" Please give an example and explain.

2. Where, in your everyday life, would you use all of the looping techniques,

? Pseudocode for looping structures
? Operators continued
? The while loop
? The do while loop
? The for loop
? break and continue statements
? System calls

Give examples. (Please do not use any computer languages in your examples)

Example: While hair is dirty, Shampoo hair - Apply small amount of shampoo to hair, lather, rinse, and then repeat until clean. (Please be more detailed)

Purchase this Solution

Solution Summary

462 words give real life examples of loop behaviour to illustrate the technique in computing.

Solution Preview

1. If the "break" statement is not used in a case-switch structure, all the options will be gone through and evaluated instead of just the single, relevant one, which will render the program inefficient.

2. Pseudocode for looping structures
Suppose that I have to drive from my house to the post shop, bank, local library, children's crèche, a friends place and my mom's house. I do not exactly know the way (as I will check it on my GPS system when driving), but I have a general idea what way to go to visit all these places and I make a rough mental map in my mind about driving directions. This is an example of a pseudo code.

? ...

Purchase this Solution

Free BrainMass Quizzes
Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Javscript Basics

Quiz on basics of javascript programming language.

C# variables and classes

This quiz contains questions about C# classes and variables.

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.

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.