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.

22 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

The three levels of programming languages, in order from the most machine-oriented to the most human-oriented are

  1. machine language, high-level language, and assembly language
  2. machine language, high-level language, and binary representation
  3. binary representation, machine language, and assembly language
  4. machine language, assembly language, and high-level language
Question 2 Multiple Choice (Single Answer)

On which factor do the grammatical rules of a language depend?

  1. Structure
  2. Syntax
  3. Pseudocode
  4. Documentation
Question 3 Multiple Choice (Single Answer)

The process of actually writing a program in a programming language is known as _______.

  1. coding
  2. pseudocoding
  3. compiling
  4. debugging
Question 4 Multiple Choice (Single Answer)

Assembly language programs _______.

  1. differ depending on the type of computer on which they are to be executed
  2. contain instructions written in 1s and 0s
  3. do not require knowledge of the internal operations of the computer
  4. more closely resemble English than BASIC
Question 5 Multiple Choice (Single Answer)

In high-level languages, variables are referred to _______.

  1. values
  2. numbers
  3. commands
  4. names
Question 6 Multiple Choice (Single Answer)

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.

  1. logic
  2. syntax
  3. pseudocode
  4. debugging
Question 7 Multiple Choice (Single Answer)

What is the maximum number of elements that the array A can contain?
DIM A(20 TO 30)

  1. 0
  2. 10
  3. 11
  4. 100
Question 8 Multiple Choice (Single Answer)

Why is it advantageous to use descriptive variable names in programming?

  1. They make the program easier for humans to understand.
  2. They make it easier for the computer to execute the program.
  3. They make the program the most similar to machine language.
  4. There is no valid reason for using descriptive variable names.
Question 9 Multiple Choice (Single Answer)

BASIC is _______.

  1. a machine language
  2. short for Beginner’s All-Purpose Symbolic Instruction Code
  3. a high-level language
  4. useful only for writing business programs
Question 10 Multiple Choice (Single Answer)

If you press <F1> while the Save command is highlighted, _______.

  1. the program in the main memory will be saved on disk
  2. QBasic will prompt you to enter the name of the program to be saved
  3. on-line help concerning the Save command will appear on the screen
  4. an error will occur
Question 11 Multiple Choice (Single Answer)

A collection of students’ names would be stored in a(n) _______ array, whereas a listing of prices would be stored in a _______ array.

  1. string, numeric
  2. numeric, string
  3. character, string
  4. indexed, string
Question 12 Multiple Choice (Single Answer)

An efficient means of printing a two-dimensional array is to use _______.

  1. a DO WHILE...LOOP
  2. a FOR...NEXT loop
  3. two nested FOR...NEXT loops
  4. a DO UNTIL...LOOP statement
Question 13 Multiple Choice (Single Answer)

Programming languages that are more oriented towards the programmer, rather than the computer are called _______ languages.

  1. assembly
  2. machine
  3. low-level
  4. high-level
Question 14 Multiple Choice (Single Answer)

A storage location containing a value that can change during program execution is referred to as a _______.

  1. constant
  2. character string
  3. variable
  4. number
Question 15 Multiple Choice (Single Answer)

Machine language programs are written using which of the following?

  1. English-like words
  2. 1s and 0s representing high and low electrical states
  3. BASIC
  4. Symbolic names to represent storage locations
Question 16 Multiple Choice (Single Answer)

How many storage locations will be reserved by the following statement?
DIM N$(1 TO 15, 1 TO 6)

  1. 15
  2. 21
  3. 90
  4. 6
Question 17 Multiple Choice (Single Answer)

A _______ locates an item by repeatedly dividing a list in half and examining the middle element until the target value is found.

  1. bubble sort
  2. binary search
  3. sequential search
  4. merge sort
Question 18 Multiple Choice (Single Answer)

A bubble sort compares _______ elements.

  1. contrasting
  2. first and last
  3. even numbered
  4. adjacent
Question 19 Multiple Choice (Single Answer)

Which of the following statements best explains the processing of a sequential search?

  1. It searches an array by starting at the middle and working out in both the directions.
  2. It compares adjacent array elements, exchanging them if they are out of order.
  3. It searches an array from beginning to the end, until the specified element is located.
  4. It combines two sorted arrays into a single sorted array.
Question 20 Multiple Choice (Single Answer)

Sublists sorted independently of each other is a characteristic of a _______.

  1. bubble sort
  2. shell sort
  3. binary search
  4. sequential search
Question 21 Multiple Choice (Single Answer)

In a shell sort, the second gap is _______ .

  1. 1/2 the length of the array
  2. 1/2 of the first gap
  3. 1/2 of the third gap
  4. 1/2 of itself
Question 22 Multiple Choice (Single Answer)

One of the conditions used to control the DO WHILE...LOOP in a binary search is that

  1. the target value should match the middle value
  2. the last element of the array should have been reached
  3. the size of the gap should be zero
  4. the size of the gap should be greater than zero