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
-
Only one
-
Two or less
-
One or more
-
INPUT statements do not accept values
C
Correct answer
Explanation
The INPUT statement can accept multiple values in a single entry. Values are separated by commas, allowing one or more data points to be entered at once.
-
the prompt to print in the next available space
-
a line to be skipped in the output
-
a question mark to appear on the screen at the end of the statement
-
an error to occur
C
Correct answer
Explanation
A semicolon after the prompt suppresses the automatic newline and causes a question mark to appear at the end of the prompt, signaling that input is expected.
C
Correct answer
Explanation
INPUT is designed for interactive data entry where values change frequently. PRINT only outputs, LET assigns fixed values, and PROMPT is not a standard BASIC statement.
-
Error numeric value expected
-
Error character string expected
-
Redo from last entry
-
Redo from start
D
Correct answer
Explanation
When the user enters incorrect data type in BASIC INPUT (e.g., text when number expected), the message 'Redo from start' prompts re-entry from the beginning.
C
Correct answer
Explanation
The CLS (Clear Screen) command is used to clear the output screen in BASIC programming. This removes any previous text or output, providing a clean slate for displaying new program results. It's especially useful when you want fresh, uncluttered output for the user.
-
NumPeople
-
Num.People
-
Num_People
-
NUMPEOPLE
-
Linker
-
Loader
-
Compiler
-
Editor
-
Assembler
D
Correct answer
Explanation
A source code editor is a text editor program designed specifically for editing source code of computer programs by programmers.
-
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
D
Correct answer
Explanation
Machine language uses raw binary instructions directly executed by the CPU. Assembly language adds mnemonics for machine instructions but remains hardware-specific. High-level languages use human-readable abstractions and are machine-independent.
-
coding
-
pseudocoding
-
compiling
-
debugging
A
Correct answer
Explanation
Coding is the process of writing actual program instructions in a programming language. Pseudocoding creates algorithmic drafts, compiling translates code to machine language, and debugging fixes errors.
-
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
A
Correct answer
Explanation
Assembly language is machine-dependent because its instructions directly map to specific CPU architectures and instruction sets. Different processor families have different assembly languages, unlike portable high-level languages like BASIC.
-
values
-
numbers
-
commands
-
names
D
Correct answer
Explanation
High-level languages use descriptive names as symbolic references to memory locations and values. These names make programs readable for programmers while the compiler handles memory addresses.
-
a machine language
-
short for Beginner’s All-Purpose Symbolic Instruction Code
-
a high-level language
-
useful only for writing business programs
B
Correct answer
Explanation
BASIC stands for Beginner's All-Purpose Symbolic Instruction Code. It is a high-level language designed for beginners and general-purpose applications, not machine language or business-only use.
-
assembly
-
machine
-
low-level
-
high-level
D
Correct answer
Explanation
High-level programming languages are designed to be easier for humans to read, write, and understand. They use English-like statements and abstractions that hide complex machine operations. Low-level languages like assembly and machine code are closer to how computers actually process data.
-
English-like words
-
1s and 0s representing high and low electrical states
-
BASIC
-
Symbolic names to represent storage locations
B
Correct answer
Explanation
Machine language is the lowest-level programming language, directly executable by the computer's CPU. It consists entirely of binary digits (1s and 0s) representing high and low electrical states. This is what all high-level languages must eventually be translated into for execution.
-
It translates one statement of high level language program to machine language and immediately execute it.
-
A translate which translates entire high level language to machine language and then executes it.
-
It executes the program only.
-
None of the above
B
Correct answer
Explanation
A compiler translates the entire high-level language program to machine language before execution, creating an executable file. This distinguishes it from interpreters (which translate and execute one statement at a time, described in option A) and pure executors. Option B correctly describes the compiler's two-step process.