Kips Class 7 IT Beans Chapter 9 Looping Statements

Chapter 9 Looping Statements

Brain Developers
A. Fill in the blanks:
1. __________ means repeated execution of statements for fixed number of times in a program.
2. The ______________ variable keeps track of the number of times a process is executed.
3. The control variable is assigned an ______________ and __________________ value in FOR…NEXT statement.
4. FOR statement is always used along with the _______________ statement.
5. All the statements, which are to be executed in a loop, come in between ____________ statements.
6. The ______________ statement increments/decrements the value of the control variable.
7. ASCII Character ____________ can also create a Beep sound.
Answer:

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)
Correct Answer: NEXT statement increments the value of the control variable by one.
3. The same control variable can be used in different loops. (False)
Correct Answer: The same control variable cannot be used in different loops.
4. In Nested Loop, the outermost loop will be executed first, before the inner loop. (True)
5. There can be maximum of 9 loops within a loop. (True)
6. WEND clause is used for FOR statement. (False)
Correct Answer: WEND clause is used for WHILE statement.
7. STEP value can never be negative. (False)
Correct Answer: STEP value can be negative or positive.

C. Application Based Questions:
1. 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?
Answer:
She can use STEP 5 clause to use with FOR…NEXT.

2. 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.
Answer:
Counter Variable/Control Variable

3. 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?
Answer:

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?
a) Control
b) NEXT
c) FOR
Answer:
a) Control

2. Which value is optional and can either be positive or negative?
a) FOR
b) STEP
c) NEXT
Answer:
b) STEP

3. Which statement combines the initialization and checking steps of counters in a single statement?
a) DO
b) WHILE
c) FOR
Answer:
b) WHILE

4. Which statement gives the increment to control variable, and directs the program control back to FOR statement.
a) NEXT
b) FOR
c) STEP
Answer:
a) NEXT

5. Which statement shifts the control back in the WHILE statement?
a) WHILE
b) WEND
c) DO
Answer:
b) WEND

6. Which command plays music in the background in QB64?
a) MB
b) MF
c) T
Answer:
a) MB

E. Answer the following:
1. Explain the term looping.
Answer:
Looping means repeated execution of a statement or a set of statements. It reduces the number of statements to be written in a program.

2. Define the FOR…NEXT looping statement.
Answer:
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.

3. What is the use of STEP statement in FOR…NEXT?
Answer:
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.

4. Describe the term nested loop.
Answer:
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.

5. How is WHILE…WEND loop different from DO UNTIL loop?
Answer:
WHILE…WEND statement is executed repeatedly while a given condition remains true, whereas DO UNTIL statement is executed while a given condition remains false or becomes true.

6. Which variable stores the sum of the numbers entered during the execution of a loop?
Answer:
Accumulator stores the sum of the numbers entered during the execution of a loop.

7. What is the function of GOSUB statement?
Answer:
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.

8. What is the difference between Play and Beep statement?
Answer:
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.

2 comments:

Also read!

Class 6 Solutions

• Class 7

Class 7 Computer Kips Solutions
Class 7 Gul Mohar English Solutions
English Grammar Class 7
English Writing Skills Class 7
Class 7 Map Pointing Solutions
Class 7 NCERT Civics Solutions
Class 7 NCERT Civics Notes
Class 7 NCERT Civics Extra Questions
Class 7 NCERT Geography Solutions
Class 7 NCERT Geography Notes
Class 7 NCERT Geography Extra Questions
Class 7 NCERT History Solutions
Class 7 NCERT History Notes
Class 7 NCERT History Extra Questions
Class 7 NCERT Maths Solutions
Class 7 NCERT Science Solutions
Class 7 NCERT Science Notes
Class 7 NCERT Science Extra Questions

• Class 8

Class 8 Kips Artificial Intelligence Solutions
Class 8 Gul Mohar English Solutions
English Grammar Class 8
English Writing Skills Class 8
Class 8 Map Pointing Solutions
Class 8 NCERT Civics Solutions
Class 8 NCERT Civics Notes
Class 8 NCERT Civics Extra Questions
Class 8 NCERT Geography Solutions
Class 8 NCERT Geography Notes
Class 8 NCERT Geography Extra Questions
Class 8 NCERT History Solutions
Class 8 NCERT History Notes
Class 8 NCERT History Extra Questions
Class 8 NCERT Maths Solutions
Class 8 NCERT Science Solutions
Class 8 NCERT Science Notes
Class 8 NCERT Science Extra Questions
Class 8 NCERT Science Exemplar
Class 8 NCERT Science MCQs

Class 9 Solutions

• Class 10

Class 10 Kips Artificial Intelligence Solutions
Class 10 NCERT English Solutions
→ Class 10 Map Pointing Solutions
Class 10 NCERT Civics Solutions
Class 10 NCERT Civics Notes
Class 10 NCERT Civics Extra Questions
Class 10 NCERT Geography Solutions
Class 10 NCERT Geography Notes
Class 10 NCERT Geography Extra Questions
Class 10 NCERT History Solutions
→ Class 10 NCERT History Notes
Class 10 NCERT History Extra Questions
Class 10 NCERT Maths Solutions
Class 10 NCERT Science Solutions
Class 10 NCERT Science Notes
Class 10 NCERT Science Extra Questions

• Computer languages
Python Basics

• Extra Activities
Extra Activities

• Extra Knowledge
Extra Information
General Knowledge
Historical Places in India
Latest technology
Physical Sciences
Facts

• Mathematics quick links
Mathematical Terms
Maths Tricks

CONTACT US