Kips IT Beans Class 7 Chapter 9 Solutions LOOPING STATEMENTS

TextbookKips IT Beans
Class7
SubjectComputer
Chapter9 LOOPING STATEMENTS
Other ChaptersChapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 10
Chapter 11
Chapter 12

Kips IT Beans Class 7 Chapter 9 Solutions LOOPING STATEMENTS

Brain Developer

A. Fill in the blanks:

1. Looping means repeated execution of statements for fixed number of times in a program.

2. The Counter variable keeps track of the number of times a process is executed.

3. The control variable is assigned an Initial and Final value in FOR…NEXT statement.

4. FOR statement is always used along with the NEXT statement.

5. All the statements, which are to be executed in a loop, come in between FOR…NEXT statements.

6. The STEP statement increments/decrements the value of the control variable.

7. ASCII Character 7 can also create a Beep sound.


B. State True or False:

1. Looping technique reduces the number of instructions. – TRUE

2. FOR statement increments the value of the control variable by one. – FALSE

3. The same control variable can be used in different loops. – FALSE

4. In Nested loop, the outermost loop will be executed first, before the inner loop. – TRUE

5. There can be a maximum of 9 loops within a loop. – TRUE

6. WEND clause is used with FOR statement. – FALSE

7. STEP value can never be negative. – FALSE


C. Application Based Questions:

Ritu is making a program using FOR NEXT statement. She wants to give increment to the counter by the value 5 but she is not able to apply the clause. Which clause will you suggest her to use with FOR…. NEXT?

Ritu can use STEP 5 Clause to use with FOR…NEXT.

Raman’s teacher asked him to name the variable, which keeps count of the number of repetitions performed in a loop but he is unable to recollect the same. Help Raman to answer this query.

Counter Variable/Control Variable

The teacher asked Priya to make a program and print the series 2, 5, 10,… 101. She wants that the program should run for 10 times. What logic will you suggest her to apply to get the desired output?

FOR J = 1 To 10
I=1, N = 12+1
NEXT


D. Multiple Choice Questions:

1. Which variable keeps track of the ‘number of times’ a particular instruction has been executed in a loop?

  • Control
  • NEXT
  • FOR

2. Which value is optional and can either be positive or negative?

  • For
  • STEP
  • NEXT

3. Which statement combines the initialization and checking steps of counters in a single statement?

  • DO
  • WHILE
  • FOR

4. Which statement gives the increment to control variable, and directs the program control back to FOR statement.

  • NEXT
  • FOR
  • STEP

5. Which statement shifts the control back in the WHILE statement?

  • WHILE
  • WEND
  • DO

6. Which command plays music in the background in QB64.

  • MB
  • MF
  • T

E. Answer the following:

Explain the term looping.

Looping means repeated execution of statements for a fixed number of times. The advantage of using looping technique in programming is that it reduces the number of instructions and also the memory space.

Define the FOR….NEXT looping statement.

FOR…NEXT statement is used when a group of statements is to be executed a specific number of times. Control variable is assigned an initial value and a final value with FOR statement. The NEXT statement increments the value of control variable by one and transfers the control back to the FOR statement.

What is the use of STEP statement in FOR…NEXT?

By default, the NEXT statement increments the value of the control variable by 1, but we can increase or decrease the value as per our choice using STEP statement. STEP value is optional and can either be positive or negative.

Describe the term nested loop.

The use of a loop statement within another loop statement is known as nested loop. For example, the FOR…NEXT which lies outside or encloses the second FOR…NEXT statement is called Inner Loop. The one, which lies inside is called Outer Loop.

How is WHILE…WEND loop different from DO UNTIL loop?

WHILE…WEND statement is executed repeatedly while a given condition remains true.
DO UNTIL statement is executed while a given condition remains false or becomes true.

Which variable stores the sum of the numbers entered during the execution of a loop?

Accumulator stores the sum of the numbers entered during the execution of a loop.

What is the function of GOSUB statement?

GOSUB statement is used to transfer the program control from one statement to another in a program. It is similar to GOTO statement, except when it encounters a RETURN statement, the program returns back to the GOSUB command.

What is the difference between Play and Beep statement?

The PLAY statement is used for playing musical notes in QB64. It can play one note at a time using different string characters. Another way to produce sound in QB64 is through BEEP statement. This statement can be placed anywhere in the program to alert the user that an error has occurred.


Other Chapter Solutions

Leave a comment