Page 77 - ModularV1.1 _c6_flipbook
P. 77
2. FOR N = 1 TO 10
PRINT "I had " + N + " slices of pizza."
NEXT N
3. sum = 0
FOR N = 1 TO 40 STEP 4
sum = sum + N
NEXT N
PRINT "sum = " + sum
4. number = 1
WHILE number < 10
PRINT number
number = number + 3
END WHILE
In the lab Computational Thinking
Write a program to:
check whether a given number is positive or negative.
input the year from the user and check whether the input year is a leap year or not.
compare two numbers and print the result accordingly.
print the series 1, 4, 7, 10, ..., 40 using FOR…NEXT statement.
input the number and print the reverse of the input number.
print the table of the number input by the user, using FOR…NEXT statement.
display all the odd numbers and even numbers from 1 to 30 using WHILE…END...WHILE
statement.
Also, print the sum of all the odd and even numbers separately.
create a FOR loop to print the Fibonacci series. For example 0, 1, 1, 2, 3, 5, 8, 13, 21, etc.
Teacher's Corner
1. Discuss about conditional statements of BASIC-256 with the students.
2. Go through all the topics covered in this chapter.
3. Explain the concept of looping statements to the students.
Conditional and Looping Statements in BASIC-256 75

