Computer Knowledge

Programming Languages and Compilers

2,284 Questions

Programming languages and compilers involve the rules, syntax, and semantics used to write and execute software programs. Key areas include scripting languages, object oriented concepts, and parsing algorithms like top down parsers. Practice these computer science questions to build proficiency for technical and computer knowledge exams.

Object oriented languagesScripting languagesCompilers and parsersProgramming syntax

Programming Languages and Compilers Questions

Multiple choice technology programming languages
  1. PLACE RECORDS IN label IN [LIST] listname

  2. PLACE RECORDS IN label ON [LIST] listname

  3. PLACE RECORDS ON label ON [LIST] listname

  4. PLACE RECORDS ON label IN [LIST] listname

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The correct syntax in Model 204 User Language for placing records onto a list is PLACE RECORDS IN label ON [LIST] listname.

Multiple choice technology programming languages
  1. CLEAR LIST IN listname

  2. CLEAR LIST listname

  3. CLEAR LIST ON listname

  4. CLEAR listname

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The correct syntax for CLEAR LIST in Model 204 is 'CLEAR LIST listname' without any preposition like IN or ON. This command removes all entries from the specified list. Option B correctly shows the proper syntax. Options A and C are incorrect because they use unnecessary prepositions (IN, ON). Option D is incorrect because it omits the required LIST keyword.

Multiple choice technology programming languages
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The ADD statement in Model 204 can only be used to add new field values to a record within the FOR EACH RECORD loop. This restriction ensures that additions are properly context-aware and associated with the correct record. Option A (True) correctly states this limitation. Option B (False) is incorrect because the ADD statement cannot be used outside the loop context.

Multiple choice technology programming languages
  1. LIST$
  2. LIST listname

  3. Listname

  4. None of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

LIST$ is the correct syntax to reference a list collection in a FIND condition. The $ symbol is the standard identifier for list variables in this system, while other options either use incorrect keywords or incomplete syntax.

Multiple choice technology programming languages
  1. REMOVE RECORDS IN label FROM [LIST] listname

  2. REMOVE RECORDS FROM [LIST] listname

  3. DELETE RECORDS IN label FROM [LIST] listname

  4. DELETE RECORDS FROM [LIST] listname

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The correct syntax is REMOVE RECORDS IN label FROM [LIST] listname. This removes records identified by a found set label from a specified list. The IN clause specifies which found set to use, and FROM [LIST] identifies the target list. Option B is missing the required IN label clause.

Multiple choice technology programming languages
  1. The code will fail at line 1 because a hash cannot contain both numeric and string data.

  2. The code will execute without error but will output nothing.

  3. The code will output the following: 32oz 16oz 8oz

  4. The code will output the following: large medium small

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The keys of %hash are sorted alphabetically: 'large', 'medium', 'small'. The loop iterates through these keys and prints their corresponding values: hash{large} (32oz), hash{medium} (16oz), and hash{small} (8oz), resulting in '32oz 16oz 8oz'.

Multiple choice technology programming languages
  1. W

  2. X

  3. Y

  4. Z

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The sort function arranges the array elements alphabetically to ('W','X','Y'). The unshift function adds 'Z' at the beginning of the array, making it ('Z','W','X','Y'). Printing $array[0] outputs 'Z', the first element after unshift adds it to the front.