WorksheetsBASIC Programming Fundamentals Assessment
Total questions: 20
Worksheet time: 10mins
What is the primary purpose of the REM statement in BASIC programming?
To perform mathematical calculations
To add comments and documentation to the code
To read data from external sources
To print output to the screen
In BASIC, which statement is used to assign a value to a variable?
ASSIGN
SET
LET
VAR
The INPUT statement is used to:
Display data on the screen
Accept data from the user during program execution
Store data in program memory
Write data to a file
What is the correct way to store the value 42 in a variable named X using LET?
X = 42
LET 42 = X
LET X -> 42
LET X = 42
The DATA statement in BASIC is used in conjunction with which other statement?
READ
LET
INPUT
Which statement is used to display text or variables on the screen?
DISPLAY
SHOW
OUTPUT
What is the purpose of the END statement?
To terminate program execution
To end a loop
To close a file
To clear the screen
In what order are DATA statements read?
Random order
Reverse order
Sequential order
Alphabetical order
Which statement would be most appropriate for adding an explanation of what your program does?
NOTE
REM
COMMENT
DOC
What happens if you try to READ more items than are available in DATA statements?
The program continues with empty values
The program automatically restarts
An error occurs
The previous values are reused
How many times can DATA statements be READ in a program?
Only once unless RESTORE is used
Unlimited times automatically
Three times maximum
Depends on the variable type
The PRINT statement can display:
Only text strings
Only numeric values
Only variables
Both text and numeric values
What is the main difference between INPUT and READ?
INPUT requires user interaction, READ uses stored DATA
INPUT is faster than READ
READ requires user interaction, INPUT uses stored DATA
There is no difference
Which statement would you use to store multiple values that will be used later in the program?
STORE
SAVE
DATA
HOLD
REM statements are:
Executed by the program
Ignored by the program
Required for the program to run
Only allowed at the beginning of the program
The LET statement in modern BASIC is:
Required for all variable assignments
Optional in most versions
No longer supported
Only used with string variables
When using the INPUT statement, what happens if the user enters the wrong type of data?
The program automatically corrects it
An error occurs
The program ignores it
The program terminates
Which statement combination is typically used to read multiple data items?
INPUT and PRINT
READ and DATA
LET and INPUT
PRINT and DATA
In BASIC, the END statement:
Must be the last physical line in the program
Can be placed anywhere in the program
Must have a line number
Can only be used in loops
What happens to REM statements during program execution?
They slow down the program
They are displayed on screen
They are skipped entirely
They are stored in memory
