BASIC Programming Fundamentals
Covers programming language concepts including machine, assembly, and high-level languages; variables and syntax errors; arrays; and searching/sorting algorithms in BASIC programming.
Questions
The three levels of programming languages, in order from the most machine-oriented to the most human-oriented are
- machine language, high-level language, and assembly language
- machine language, high-level language, and binary representation
- binary representation, machine language, and assembly language
- machine language, assembly language, and high-level language
On which factor do the grammatical rules of a language depend?
- Structure
- Syntax
- Pseudocode
- Documentation
The process of actually writing a program in a programming language is known as _______.
- coding
- pseudocoding
- compiling
- debugging
Assembly language programs _______.
- differ depending on the type of computer on which they are to be executed
- contain instructions written in 1s and 0s
- do not require knowledge of the internal operations of the computer
- more closely resemble English than BASIC
In high-level languages, variables are referred to _______.
- values
- numbers
- commands
- names
If you used the formula length + width to calculate the area of a rectangle (when it should be length x width), you would have made a _______ error.
- logic
- syntax
- pseudocode
- debugging
What is the maximum number of elements that the array A can contain?
DIM A(20 TO 30)
- 0
- 10
- 11
- 100
Why is it advantageous to use descriptive variable names in programming?
- They make the program easier for humans to understand.
- They make it easier for the computer to execute the program.
- They make the program the most similar to machine language.
- There is no valid reason for using descriptive variable names.
BASIC is _______.
- a machine language
- short for Beginner’s All-Purpose Symbolic Instruction Code
- a high-level language
- useful only for writing business programs
If you press <F1> while the Save command is highlighted, _______.
- the program in the main memory will be saved on disk
- QBasic will prompt you to enter the name of the program to be saved
- on-line help concerning the Save command will appear on the screen
- an error will occur
A collection of students’ names would be stored in a(n) _______ array, whereas a listing of prices would be stored in a _______ array.
- string, numeric
- numeric, string
- character, string
- indexed, string
An efficient means of printing a two-dimensional array is to use _______.
- a DO WHILE...LOOP
- a FOR...NEXT loop
- two nested FOR...NEXT loops
- a DO UNTIL...LOOP statement
Programming languages that are more oriented towards the programmer, rather than the computer are called _______ languages.
- assembly
- machine
- low-level
- high-level
A storage location containing a value that can change during program execution is referred to as a _______.
- constant
- character string
- variable
- number
Machine language programs are written using which of the following?
- English-like words
- 1s and 0s representing high and low electrical states
- BASIC
- Symbolic names to represent storage locations
How many storage locations will be reserved by the following statement?
DIM N$(1 TO 15, 1 TO 6)
- 15
- 21
- 90
- 6
A _______ locates an item by repeatedly dividing a list in half and examining the middle element until the target value is found.
- bubble sort
- binary search
- sequential search
- merge sort
A bubble sort compares _______ elements.
- contrasting
- first and last
- even numbered
- adjacent
Which of the following statements best explains the processing of a sequential search?
- It searches an array by starting at the middle and working out in both the directions.
- It compares adjacent array elements, exchanging them if they are out of order.
- It searches an array from beginning to the end, until the specified element is located.
- It combines two sorted arrays into a single sorted array.
Sublists sorted independently of each other is a characteristic of a _______.
- bubble sort
- shell sort
- binary search
- sequential search
In a shell sort, the second gap is _______ .
- 1/2 the length of the array
- 1/2 of the first gap
- 1/2 of the third gap
- 1/2 of itself
One of the conditions used to control the DO WHILE...LOOP in a binary search is that
- the target value should match the middle value
- the last element of the array should have been reached
- the size of the gap should be zero
- the size of the gap should be greater than zero