🚗
🤖
🗼 💻 🖥️ ðŸ§
🖥️
🗼
✨ Computer Science Assessment ✨
COMPUTISM LAb
HALF YEARLY EXAMINATION
Conditional and Looping Statements in BASIC-256
ðŸ§
🤖
Standard: Computer Studies
Max Marks: 70
Time Allowed: 3 Hours
Section A: Fill in the Blanks10 Marks
- The conditional statements in BASIC-256 are also called statements.
- The statement is used to repeat a set of instructions until a condition evaluates to false.
- The is the starting number of the loop and the is the total number of times the loop must run.
- The is a variable that keeps count of the number of times the instructions inside the loop have been executed.
- A loop which never ends is called an loop.
- The statement checks a condition and executes a specific block of code if true.
- BASIC-256 provides types of looping statements primarily.
- The keyword is used to close a WHILE loop structure.
- Decision making in programming is handled by structures.
- The loop variable changes its value incrementally using the parameter if specified.
Section B: Multiple Choice Questions (MCQs)10 Marks
- Which statement is used to end the WHILE loop?
- a. END WHILE
- b. WHILE
- c. END-WHILE
- d. STOP
- Which of the following is not a conditional statement in BASIC-256?
- a. IF-THEN
- b. IF-THEN-ELSE
- c. FOR-NEXT
- d. None of these
- Which loop statement do we use when we don't know the exact loop count?
- a. WHILE
- b. FOR
- c. Both a and b
- d. IF
- What does a loop do in programming?
- a. Repeats a section
- b. Sets a variable
- c. Print Hello
- d. Terminate program
- In the statement FOR n = 1 TO 100, what is 1?
- a. Branch
- b. Counter variable
- c. Start value
- d. Condition
- Which keyword starts a definite loop in BASIC-256?
- a. FOR
- b. WHILE
- c. LOOP
- d. REPEAT
- What type of statement is IF-THEN?
- a. Sequential
- b. Conditional / Decision making
- c. Looping
- d. Input command
- What is an infinite loop?
- a. A loop that never ends
- b. A loop running 100 times
- c. A fast loop
- d. An error message
- Which statement is used alongside FOR to increment and conclude the loop structure?
- a. NEXT
- b. STOP
- c. END
- d. BREAK
- What happens if the condition in an IF-THEN statement evaluates to false?
- a. Statement block is skipped
- b. Program crashes
- c. Loop starts
- d. Infinite loop runs
Section C: Assertion-Based MCQs10 Marks
-
Assertion (A): Conditional statements alter the normal sequential flow of program execution.
Reason (R): They allow programs to make decisions and execute specific blocks based on boolean conditions.
a) Both A and R are true, and R is the correct explanation of A.
b) Both A and R are true, but R is not the correct explanation of A.
c) A is true, but R is false.
d) A is false, but R is true. -
Assertion (A): The FOR-NEXT statement is a definite loop structure.
Reason (R): It runs for a fixed and predetermined number of times controlled by start and end counters.
a) Both A and R are true, and R is the correct explanation of A.
b) Both A and R are true, but unrelated.
c) A is true, R is false.
d) A is false, R is true. -
Assertion (A): An infinite loop terminates automatically after running 10 times.
Reason (R): An infinite loop condition never becomes false, causing it to run continuously forever.
a) Both A and R are true.
b) A is true, but R is false.
c) A is false, but R is true.
d) Both A and R are false. -
Assertion (A): The WHILE loop checks its condition before executing the loop body statements.
Reason (R): If the initial condition is false, the statements inside the WHILE loop may never execute.
a) Both A and R are true, and R is the correct explanation of A.
b) Both are false.
c) A is true, R is false.
d) A is false, R is true. -
Assertion (A): BASIC-256 uses the END WHILE keyword to mark the completion of a WHILE loop.
Reason (R): Without a proper closing keyword, the interpreter cannot identify where the loop block ends.
a) Both A and R are true, and R is the correct explanation of A.
b) Both A and R are true, but unrelated.
c) A is true, R is false.
d) A is false, R is true. -
Assertion (A): The IF-THEN-ELSE statement handles conditions with two alternate outcomes.
Reason (R): It executes one block if the condition is true and a separate alternative block if it is false.
a) Both A and R are true, and R is the correct explanation of A.
b) A is true, R is false.
c) A is false, but R is true.
d) Both A and R are false. -
Assertion (A): A counter variable inside a loop remains constant and never changes value.
Reason (R): Counter variables increment or decrement with each iteration to track loop progress.
a) Both A and R are true.
b) A is true, R is false.
c) A is false, but R is true.
d) Both A and R are false. -
Assertion (A): Program branching and decision making are synonymous terms for control structures.
Reason (R): They control code flow based on whether specified parameters evaluate as true or false.
a) Both A and R are true, and R is the correct explanation of A.
b) Both are false.
c) A is true, R is false.
d) A is false, R is true. -
Assertion (A): Sequential statements execute line by line without skipping or repeating instructions.
Reason (R): Sequential execution involves complex loops and conditional branching.
a) Both A and R are true.
b) A is true, but R is false.
c) A is false, but R is true.
d) Both are false. -
Assertion (A): Using loop structures reduces code redundancy and saves programming time.
Reason (R): Loops allow repetitive tasks to be executed cleanly through concise blocks of code.
a) Both A and R are true, and R is the correct explanation of A.
b) Both A and R are true, but unrelated.
c) A is true, R is false.
d) A is false, but R is true.
Section D: True or False10 Marks
- The IF-THEN statement is the simplest conditional statement. (True / False)
- The statements used to repeat a set of instructions in a program are called iterative statements or looping statements. (True / False)
- The WHILE statement is used to repeat a task for a fixed number of times. (True / False)
- While loop is a replacement of the IF-THEN statement. (True / False)
- While-EndWhile loop is known as a Condition Control loop. (True / False)
- BASIC-256 provides two types of looping statements: FOR...NEXT and IF-THEN. (True / False)
- An infinite loop stops automatically when the computer runs out of memory. (True / False)
- The NEXT keyword is mandatory to close a FOR loop structure in BASIC-256. (True / False)
- Conditional statements help a program choose between different execution paths. (True / False)
- Branching and looping are both categories of control statements. (True / False)
Section E: Two-Marks Questions & BASIC-256 Programs30 Marks
- What is spyware?(2 Marks)
- Write short note on firewall. (2 Marks)
- Why antivirus is needed? (2 Marks)
- Define an infinite loop and state why it occurs. (2 Marks)
- What is Trojan horse? (2 Marks)
-
Program 1: Write a BASIC-256 program using IF-THEN to check if an entered number is positive. (4 Marks)
-
Program 2: Write a BASIC-256 program using FOR...NEXT to print numbers from 100 to 10. (4 Marks)
-
Program 3: Write a BASIC-256 program using WHILE...END WHILE to print numbers from 1 to 5. (4 Marks)
-
Program 4: Write a BASIC-256 program using IF-THEN-ELSE to check if a person is eligible to vote (age >= 18). (4 Marks)
-
Program 5: Write a BASIC-256 program using FOR...NEXT to print even numbers up to 100. (4 Marks)
⭐ Best of Luck for Your Examination! Code with Confidence! 🚀
CREATED BY BIJAN KRISHNA PAUL
No comments:
Post a Comment