preview

Questions On Learning Objectives And Outcomes

Good Essays

LESSON 3: LOOPING
LEARNING OBJECTIVES AND OUTCOMES
• Introduction
• Additional Features of FOR Loop
• Nesting of For loops
• Jumps in loops Jumping out of a loop
• Skipping a part of a loop
• Labeled Loops
• Classes
INTRODUCTION
Computers are quite efficient in performing task repeatedly. It can efficiently perform same operation 10,000 times without exhausting. Looping is the process of executing a block of statements repeatedly. It ranges from zero to infinite with full efficiency. When looping continues forever, it is known as infinite looping. Hence, to avoid infinite looping some termination conditions are required. JAVA supports this feature. It has control statements which allow looping only after checking test conditions. If test conditions are satisfied, statement block will execute otherwise it will not.
Looping process in JAVA includes certain steps which are follows:
1. Setting and initializing counter.
2. Execution of statement block.
3. Testing of test conditions before execution of loop.
ADDITIONAL FEATURES OF FOR LOOP
There are several capabilities of for loop which other looping constructs lag behind. Some of these features are explained below with the help of examples:
• Initialization Section: a=1; for (i=1; i0; z=z/2)
JAVA also allows us to use expressions in assignment statements.
• Omitting Sections:
…………
………… a=2; for ( ; a!=15 ; )
{
System.out.println (a); A=a+2;
}
…………..
…………..
It is one of the unique features of JAVA that it can omit one or

Get Access