8 Cbse Notes
8 Cbse Notes
Ans. A CPU register that either stores the memory adress from which data will be
fetched to the CPU or the adress to which data will be sent and stored.
3.What are the differnt kinds of monitor?Explain.
1.LCD monitors
2. CRT monitors
CRT monitors look much like old-fashioned televisions and very deep in size.
LCD monitors are much thinner,use less energy and provide a great graphics
quality.
Control statement:
The statements that governs the flow of control of the script rae called control
statements.
1.Conditional statement
2.Iterative statement
Conditional statement:
Syntax:
IF condition THEN
Statement(s)
ELSE
Statement(s)
END IF
In this,If condition stands true then the program wil execute the
statement(s)following it and if condition stands false then the program will not
execute the following statement.
For Example:
Program to accept marks and print “YOU SCORED WELL” if marks are
greater then or equal to 80.
INPUT Marks
IF Marks>=80 THEN
END IF
END
IF---THEN---ELSE:
INPUT NUM
ELSE
END IF
END
Iterative statements:
Iterative statements or loops used to repeat an action again and again for a
specific number of times.Some of the looping constructs in BASIC are:
For------NEXT
WHILE-----WEND
Arrays:
An array is a type of variable that groups a series of values and places them in a
single variable.thase sre useful when you need to store a similar type of dat
because they make it easeier tomanipulate the data together.Array is declared
using the keyword DIM.
Syntax to declare array:
DIM ArrayName(Num)
Where ArrayNam is name of the array
Num is the number of elements in the array.
Example:
DIM MARKS(10)
Answer the following:
1.Define control statement.Mention the types with example.
Ans.The statements that govern the flow of control of the script are called as
control statements.
Their are two types of control statements:
Conditional statements: IF--THEN, IF—THEN—ELSE.
Iterative statements: For—NEXT, WHILE---WEND.
5. Write a program which take 10 numbers as input and output the average.
Ans.
DIM NUMARR (10)
SUM=0
FOR I= 1 To 10
INPUT “Enter the number:”; NUMARR (I)
SUM=SUM+NUMARR (I)
NEXT I
AVG=SUM/10
PRINT “The average is “;AVG
END
6. Write a program to print the squares of each of the first ten even numbers,one by one.
LET Even=2
LET Counter=0
WHILE Counter<10
PRINT “squares of “;Even;”is”;Even*Even
Counter=Counter+1
Even=Even+2
WEND
END
7.Writea program to find the sum of first ten fibonacci numbers(starting from 1)
CLS
DIM FIB(10)
SUM=0
FIB(2)=1
FIB(1)=1
For I= 3 To 10
FIB(I)= FIB(I-1) + FIB(I-2)
NEXT I
For I=1 To10
SUM=SUM+FIB(I)
NEXT I
Print “The required sum:”SUM