Introduction to Programming Languages
- 70Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What is the primary purpose of a programming language?
What is the primary purpose of a programming language?
70 questions
- 1
What is the primary purpose of a programming language?
- A
To replace the hardware components of a computer
- B
To store all files permanently on a computer
- C
To communicate instructions to a computer or digital device
- D
To increase the electrical voltage inside a computer
Correct answer
CTo communicate instructions to a computer or digital device
Explanation
A programming language provides a way for humans to communicate instructions to computers and other digital devices.
- A
- 2
In the content, what is an algorithm?
- A
A collection of words used to name computer hardware
- B
A sequence of rules for performing a specific task
- C
A translator that converts machine code into English
- D
A physical component that processes electrical signals
Correct answer
BA sequence of rules for performing a specific task
Explanation
An algorithm is described as a set of rules or a sequence of steps used to perform a specific task.
- A
- 3
Why are rules necessary in a programming language?
- A
They allow computers to operate without receiving any instructions
- B
They determine which electrical outlet a computer must use
- C
They automatically convert every program into a database
- D
They specify how instructions must be written for communication with a computer
Correct answer
DThey specify how instructions must be written for communication with a computer
Explanation
Programming languages contain rules and regulations that must be followed to communicate instructions to a computer system.
- A
- 4
What does syntax describe in a programming language?
- A
The electrical signals generated by a computer processor
- B
The hardware resources consumed while a program runs
- C
The structure and form in which instructions are expressed
- D
The meaning produced by a correctly structured instruction
Correct answer
CThe structure and form in which instructions are expressed
Explanation
Syntax refers to the structure or form used to write commands and other elements of a programming language.
- A
- 5
What does semantics describe in a programming language?
- A
The meaning generated by a statement or command
- B
The physical location where a program is stored
- C
The voltage level used to represent a binary digit
- D
The punctuation and arrangement required by the language
Correct answer
AThe meaning generated by a statement or command
Explanation
Semantics refers to the meaning carried or generated by a syntactically constructed statement.
- A
- 6
Which statement best defines a programming language?
- A
It is a file format used only for saving photographs and videos
- B
It is a collection of electrical components for building a computing device
- C
It is a vocabulary and set of grammatical rules for instructing a computing device
- D
It is a translation program that converts every language into English
Correct answer
CIt is a vocabulary and set of grammatical rules for instructing a computing device
Explanation
A programming language consists of vocabulary and grammatical rules used to instruct a computer or computing device to perform tasks.
- A
- 7
What is unique about each programming language according to the definition provided?
- A
It uses a different type of computer processor for every program
- B
It has its own keywords and syntax for organizing instructions
- C
It can operate only on one specific brand of computer
- D
It must represent every instruction with a different voltage
Correct answer
BIt has its own keywords and syntax for organizing instructions
Explanation
Each programming language has a unique set of keywords and special syntax for organizing program instructions.
- A
- 8
Why can computers process combinations of 0 and 1 as instructions?
- A
Computers use 0 and 1 because those symbols represent programming keywords
- B
Computers are electronic devices that respond to high and low electrical signals
- C
Computers naturally understand spoken numbers better than written commands
- D
Computers convert all English sentences directly into binary without translation
Correct answer
BComputers are electronic devices that respond to high and low electrical signals
Explanation
Computers understand electrical signals. High voltage is represented as 1, and low voltage is represented as 0.
- A
- 9
What does a high signal represent in the computer's binary system?
- A
A low voltage represented by 1
- B
A low voltage represented by 0
- C
A high voltage represented by 0
- D
A high voltage represented by 1
Correct answer
DA high voltage represented by 1
Explanation
A high signal refers to high voltage, which computers represent as 1.
- A
- 10
What does a low signal represent in the computer's binary system?
- A
A low voltage represented by 0
- B
A high voltage represented by 1
- C
A high voltage represented by 0
- D
A low voltage represented by 1
Correct answer
AA low voltage represented by 0
Explanation
A low signal refers to low voltage, which computers represent as 0.
- A
- 11
What is machine language?
- A
A language designed to describe database tables to human users
- B
A language formed from combinations of binary digits that the computer directly understands
- C
A language formed from English phrases that requires no translation
- D
A language made only of symbolic abbreviations for programming commands
Correct answer
BA language formed from combinations of binary digits that the computer directly understands
Explanation
Machine language consists of combinations of 0 and 1, or binary digits, and is directly understood by the computer.
- A
- 12
Why do machine-language programs generally execute quickly?
- A
Machine language uses common English phrases instead of binary digits
- B
The computer understands machine language directly
- C
Machine language automatically divides programs into smaller modules
- D
Machine language stores all program data in large collections
Correct answer
BThe computer understands machine language directly
Explanation
Because machine language is directly understood by the computer, it does not require translation before execution.
- A
- 13
Which computers were programmed using first-generation machine-level languages?
- A
Vacuum-tube computers and early transistor computers
- B
Database servers and graphical workstation computers
- C
Artificial-intelligence systems and web servers
- D
Modern cloud computers and smartphone computers
Correct answer
AVacuum-tube computers and early transistor computers
Explanation
First-generation machine-level languages were used with vacuum-tube computers and early versions of transistor computers.
- A
- 14
What was a major reason machine-language programs became lengthy?
- A
Every instruction had to be represented using binary digits
- B
Every command had to be translated once for every user
- C
Every program had to contain a separate database for each variable
- D
Every instruction had to be written as a complete English sentence
Correct answer
AEvery instruction had to be represented using binary digits
Explanation
Representing each part of a task with binary digits made even simple machine-language programs very lengthy.
- A
- 15
Why was machine language difficult for many programmers to understand?
- A
It could be written only after using a high-level compiler
- B
It required programmers to memorize many English phrases
- C
Binary coding is complex and difficult to interpret
- D
It required programs to be divided into structured modules
Correct answer
CBinary coding is complex and difficult to interpret
Explanation
Machine language uses binary coding, which is difficult to read and understand, making it complex for programmers.
- A
- 16
Why were machine-language programs not portable?
- A
Machine-language programs could run only when connected to a database
- B
Machine-language programs required English syntax that varied by user
- C
Different machines used identical hardware but different screen sizes
- D
Different machines used different coding and hardware characteristics
Correct answer
DDifferent machines used different coding and hardware characteristics
Explanation
Machine-language code depended on the coding and hardware of a particular machine, so it could not generally run on another machine.
- A
- 17
Which consequence followed from the length and complexity of machine-language code?
- A
Writing machine-language programs was very time-consuming
- B
Writing machine-language programs required fewer instructions than assembly
- C
Writing machine-language programs became independent of hardware
- D
Writing machine-language programs required no testing
Correct answer
AWriting machine-language programs was very time-consuming
Explanation
The lengthy and difficult nature of binary coding made machine-language programming highly time-consuming.
- A
- 18
What motivated the development of assembly language?
- A
Programmers wanted a language easier to write than machine language
- B
Programmers wanted to eliminate all programming rules and syntax
- C
Programmers wanted programs to focus only on database operations
- D
Programmers wanted computers to stop using electrical signals
Correct answer
AProgrammers wanted a language easier to write than machine language
Explanation
Assembly language was developed to provide a more manageable alternative to difficult binary machine code.
- A
- 19
What are mnemonics in assembly language?
- A
Symbolic representations used for codes or instructions
- B
Electrical signals used to represent high voltage
- C
Large collections of information processed by a database
- D
Error messages produced after an entire program is scanned
Correct answer
ASymbolic representations used for codes or instructions
Explanation
Assembly language uses mnemonics, which are symbolic representations for various machine-related codes.
- A
- 20
How did mnemonics improve programming compared with binary machine code?
- A
They eliminated the need to convert code into machine language
- B
They made programs automatically portable across all machines
- C
They allowed computers to execute code without any processor
- D
They made code easier to write and understand
Correct answer
DThey made code easier to write and understand
Explanation
Symbolic mnemonics made assembly code easier for programmers to write and understand than binary code.
- A
- 21
Why was assembly language considered less error-prone than machine language?
- A
Its symbolic representation reduced the difficulty of writing instructions
- B
It allowed the computer to correct all logical errors automatically
- C
It removed the need for programmers to follow syntax rules
- D
It used more binary digits to represent each instruction
Correct answer
AIts symbolic representation reduced the difficulty of writing instructions
Explanation
Because assembly language was easier to write and understand, programmers were less likely to make errors while coding.
- A
- 22
What is an assembler?
- A
A program that converts database records into graphical interfaces
- B
A program that allows computers to solve problems without algorithms
- C
A program that translates machine language into assembly language during execution
- D
A program that translates assembly language into machine-level language
Correct answer
DA program that translates assembly language into machine-level language
Explanation
An assembler converts source code written in assembly language into machine-level object code.
- A
- 23
Why does assembly language require an assembler?
- A
Assembly language contains no symbolic representations
- B
The computer cannot directly understand binary machine language
- C
The computer cannot directly understand assembly language
- D
Assembly language is already written entirely as processor instructions
Correct answer
CThe computer cannot directly understand assembly language
Explanation
Computers directly understand machine language, not assembly language, so an assembler is needed to perform the conversion.
- A
- 24
Compared with machine language, what was one execution disadvantage of assembly language?
- A
It was executed directly without involving the processor
- B
It required programmers to rewrite all commands in binary twice
- C
It could not represent instructions using symbolic forms
- D
It required additional time for translation into machine code
Correct answer
DIt required additional time for translation into machine code
Explanation
Assembly code must first be translated by an assembler, adding time before the program can execute.
- A
- 25
Which characteristic did machine language and assembly language share?
- A
Both were machine-dependent and generally not portable
- B
Both allowed one program to run on every computer unchanged
- C
Both used common English phrases and were machine-independent
- D
Both focused on telling the computer what to do rather than how
Correct answer
ABoth were machine-dependent and generally not portable
Explanation
Both first- and second-generation languages depended on the hardware and coding of particular machines.
- A
- 26
What problem led to the development of third-generation languages?
- A
The need to make programs depend more closely on individual hardware
- B
The need to prevent programmers from using English words in code
- C
The need for programs to run on different computers with little modification
- D
The need to represent all instructions with longer binary sequences
Correct answer
CThe need for programs to run on different computers with little modification
Explanation
Third-generation languages were developed to reduce machine dependency and improve portability across computers.
- A
- 27
When was the third generation of programming languages developed?
- A
Between 1959 and 1965
- B
In 1965
- C
In the early 1990s
- D
Between 1940 and 1959
Correct answer
BIn 1965
Explanation
The content states that the third generation was developed in 1965 and continues to be used.
- A
- 28
What does machine independence mean for a third-generation program?
- A
It can run without being translated into machine language
- B
It can run on another computer without modification or with little modification
- C
It can execute without depending on an operating system or processor
- D
It can communicate with hardware only through binary digits
Correct answer
BIt can run on another computer without modification or with little modification
Explanation
Machine-independent programs are portable and can run on another computer unchanged or with only minor changes.
- A
- 29
How did third-generation languages make programming easier to learn?
- A
They used English words for variables, structures, and commands
- B
They required programmers to write every instruction in binary
- C
They removed the need to organize instructions into meaningful structures
- D
They replaced all commands with electrical voltage levels
Correct answer
AThey used English words for variables, structures, and commands
Explanation
Third-generation languages used English words to represent variables, programming structures, and commands.
- A
- 30
What is structured programming?
- A
Allowing a computer to select any solution without programmer input
- B
Writing every program as one uninterrupted sequence of binary digits
- C
Dividing a large program into smaller sections that perform specific tasks
- D
Converting every source statement into machine code individually
Correct answer
CDividing a large program into smaller sections that perform specific tasks
Explanation
Structured programming divides a large program into smaller sections, with each section handling a specific task.
- A
- 31
Why were third-generation languages called programmer-friendly languages?
- A
They allowed programmers to avoid using any language translator
- B
They automatically solved any problem without a programmer's algorithm
- C
They interacted directly with hardware without requiring machine code
- D
They were easier to write and learn than lower-level languages
Correct answer
DThey were easier to write and learn than lower-level languages
Explanation
Their use of English words, portability, and structured programming made third-generation languages more programmer-friendly.
- A
- 32
Why are third-generation languages also called high-level languages?
- A
They execute directly on hardware without translation
- B
They use English words to express programming instructions
- C
They use only high-voltage electrical signals
- D
They are designed exclusively for high-capacity computers
Correct answer
BThey use English words to express programming instructions
Explanation
Third-generation languages are called high-level languages because they use English-like words rather than binary or symbolic machine representations.
- A
- 33
Which group contains examples of early third-generation programming languages?
- A
OPS5, MERCURY, and Python
- B
SQL, NATURAL, and LANSA
- C
FORTRAN, ALGOL, and COBOL
- D
Assembly, machine language, and Java
Correct answer
CFORTRAN, ALGOL, and COBOL
Explanation
The first introduced third-generation languages listed are FORTRAN, ALGOL, and COBOL.
- A
- 34
What is a disadvantage of third-generation languages?
- A
They cannot use English words for variables or commands
- B
They can be understood directly by hardware without any conversion
- C
They are limited to programming only one specific computer
- D
They require translation into machine language before execution
Correct answer
DThey require translation into machine language before execution
Explanation
Because computers directly understand only machine language, third-generation source code must be translated before execution, which takes additional time.
- A
- 35
Which set contains modern third-generation programming languages mentioned in the content?
- A
Machine language, assembly language, Python, and Ruby
- B
NATURAL, M-POWER, LANSA, and OPS5
- C
C, C++, C#, and Java
- D
FORTRAN, ALGOL, COBOL, and SQL
Correct answer
CC, C++, C#, and Java
Explanation
The content identifies C, C++, C#, and Java as modern examples of third-generation languages.
- A
- 36
How do fourth-generation languages differ from third-generation languages in their use of English?
- A
They use no English because they rely exclusively on binary digits
- B
They use only symbolic mnemonics instead of words and phrases
- C
They use English only for comments while all commands remain machine code
- D
They use broader English-like syntax and phrases rather than a limited set of English words
Correct answer
DThey use broader English-like syntax and phrases rather than a limited set of English words
Explanation
Fourth-generation languages use common English-like syntax and phrases, whereas third-generation languages use a more limited set of English words.
- A
- 37
What does it mean that fourth-generation languages allow multiple operations with one command?
- A
A single command can execute only one hardware-level instruction
- B
Each command must be repeated once for every binary digit
- C
A single programmer-entered command can perform several common operations
- D
Every operation must be translated manually by the programmer
Correct answer
CA single programmer-entered command can perform several common operations
Explanation
Fourth-generation languages can carry out multiple common operations through a single command entered by the programmer.
- A
- 38
What type of information can fourth-generation languages process effectively?
- A
Only individual processor registers
- B
Only isolated binary digits
- C
Only small hardware-control instructions
- D
Large collections of information
Correct answer
DLarge collections of information
Explanation
Fourth-generation languages are designed to operate on large collections of information rather than focusing only on individual bits and bytes.
- A
- 39
Which activity is specifically associated with the use of fourth-generation languages?
- A
Writing raw binary instructions
- B
Database management
- C
Constructing transistor hardware manually
- D
Designing vacuum-tube circuits
Correct answer
BDatabase management
Explanation
Fourth-generation languages are used for database management, along with report generation, mathematical optimization, GUI development, and web development.
- A
- 40
Why are fourth-generation languages described as nonprocedural?
- A
They execute only procedures written directly in machine language
- B
They require programmers to specify every implementation step in detail
- C
They specify what task should be done while leaving the method to the language
- D
They prevent programmers from entering tasks or conditions
Correct answer
CThey specify what task should be done while leaving the method to the language
Explanation
In a nonprocedural language, the programmer states what task is needed, while the language determines how to carry it out.
- A
- 41
What is a limitation of fourth-generation languages regarding programmer control?
- A
The programmer must write separate code for every computer model
- B
The programmer must control every electrical signal manually
- C
The programmer has limited control over program execution and resources
- D
The programmer can control hardware more directly than with machine language
Correct answer
CThe programmer has limited control over program execution and resources
Explanation
Because the language carries out much of the task automatically, the programmer has limited control over the program and its resources.
- A
- 42
What hardware resources may fourth-generation language packages require because they are lengthy?
- A
Only a specialized keyboard and no processor resources
- B
More disk space and greater memory capacity
- C
Less disk space and smaller memory capacity
- D
Only additional electrical voltage and no storage space
Correct answer
BMore disk space and greater memory capacity
Explanation
The content states that fourth-generation language packages can be lengthy and therefore require more disk space and large memory capacity.
- A
- 43
Which group contains examples of fourth-generation languages?
- A
FORTRAN, ALGOL, COBOL, and Java
- B
SQL, NATURAL, M-POWER, and LANSA
- C
OPS5, MERCURY, Python, and Ruby
- D
Machine language, assembly language, C, and C++
Correct answer
BSQL, NATURAL, M-POWER, and LANSA
Explanation
SQL, NATURAL, M-POWER, and LANSA are listed as commonly used fourth-generation languages.
- A
- 44
What is the central goal of fifth-generation programming languages?
- A
To make programmers write longer binary sequences for each task
- B
To make programs depend more strongly on individual computer hardware
- C
To require programmers to specify every implementation step
- D
To enable computers to solve problems with minimal or no programmer assistance
Correct answer
DTo enable computers to solve problems with minimal or no programmer assistance
Explanation
Fifth-generation languages aim to let computers solve given problems without the programmer directly implementing the routine or algorithm.
- A
- 45
Where and when was the concept of fifth-generation programming languages first introduced?
- A
In Europe during the late 1950s
- B
In Japan during the 1960s
- C
In Japan in the early 1990s
- D
In the United States during the 1940s
Correct answer
CIn Japan in the early 1990s
Explanation
The concept was first introduced in Japan in the early 1990s and is described as a future direction of programming.
- A
- 46
What does a user primarily provide when using a fifth-generation language?
- A
The problem to solve and the conditions that must be met
- B
The hardware design and voltage sequence for the processor
- C
The complete algorithm and every implementation routine
- D
The binary representation of every required instruction
Correct answer
AThe problem to solve and the conditions that must be met
Explanation
The user focuses on the problem and required conditions rather than specifying how the solution should be implemented.
- A
- 47
In which area are fifth-generation languages mainly used?
- A
Basic transistor assembly
- B
Vacuum-tube circuit manufacturing
- C
Artificial-intelligence research
- D
Manual binary data entry
Correct answer
CArtificial-intelligence research
Explanation
Fifth-generation languages are used mainly in the development of artificial-intelligence research.
- A
- 48
Why can the development and maintenance of fifth-generation languages be complicated?
- A
They eliminate automation and require manual hardware control
- B
Their automated systems require more resources to work efficiently
- C
They cannot represent problems using conditions or goals
- D
They require every task to be written only in binary digits
Correct answer
BTheir automated systems require more resources to work efficiently
Explanation
The use of automated systems makes fifth-generation languages more complicated to develop and maintain and increases their resource requirements.
- A
- 49
Which pair contains examples of fifth-generation programming languages?
- A
C and C++
- B
SQL and NATURAL
- C
OPS5 and MERCURY
- D
FORTRAN and COBOL
Correct answer
COPS5 and MERCURY
Explanation
OPS5 and MERCURY are identified as examples of fifth-generation programming languages.
- A
- 50
Which generations are classified as low-level languages?
- A
The third and fourth generations
- B
The second and third generations
- C
The first and second generations
- D
The fourth and fifth generations
Correct answer
CThe first and second generations
Explanation
Machine language and assembly language, which are the first and second generations, are classified as low-level languages.
- A
- 51
Which generations are collectively classified as high-level languages?
- A
The first, second, and fourth generations
- B
Only the fourth and fifth generations
- C
The first, second, and third generations
- D
The third, fourth, and fifth generations
Correct answer
DThe third, fourth, and fifth generations
Explanation
The third, fourth, and fifth generations are collectively considered high-level languages.
- A
- 52
Which comparison between low-level and high-level languages is correct?
- A
Both low-level and high-level languages are equally machine-dependent
- B
Low-level languages are machine-dependent, whereas high-level languages are machine-independent
- C
Low-level languages are machine-independent, whereas high-level languages are machine-dependent
- D
Both low-level and high-level languages are always machine-independent
Correct answer
BLow-level languages are machine-dependent, whereas high-level languages are machine-independent
Explanation
The first two generations are machine-dependent, while the third through fifth generations are described as machine-independent.
- A
- 53
Which representation is associated with low-level languages?
- A
Common English phrases and database expressions
- B
Only graphical icons and natural-language questions
- C
Large collections of records and report templates
- D
Binary digits or symbolic representations called mnemonics
Correct answer
DBinary digits or symbolic representations called mnemonics
Explanation
Low-level languages use binary digits or symbolic representations known as mnemonics.
- A
- 54
Which representation is associated with high-level languages?
- A
English words and phrases
- B
Only high- and low-voltage signals
- C
Only processor-specific binary patterns
- D
Only symbolic mnemonics for hardware operations
Correct answer
AEnglish words and phrases
Explanation
High-level languages use English words and phrases to express instructions.
- A
- 55
Which statement correctly compares portability in low-level and high-level languages?
- A
Low-level programs are portable, while high-level programs must target one machine
- B
Neither type can run on another computer under any circumstances
- C
Low-level programs are generally not portable, while high-level programs are more portable
- D
Both types are equally portable because all computers use identical hardware
Correct answer
CLow-level programs are generally not portable, while high-level programs are more portable
Explanation
Low-level programs depend on machine-specific hardware, while high-level programs can generally run on other computers with little or no modification.
- A
- 56
How do low-level and high-level languages differ in hardware interaction?
- A
Both types interact with hardware directly in exactly the same way
- B
Neither type can communicate with hardware after translation
- C
High-level programs interact directly with hardware, unlike low-level programs
- D
Low-level programs can interact directly with hardware, unlike high-level programs
Correct answer
DLow-level programs can interact directly with hardware, unlike high-level programs
Explanation
Low-level programs can directly interact with system hardware, whereas high-level programs cannot do so directly.
- A
- 57
Which statement best compares the difficulty of low-level and high-level languages?
- A
Low-level languages are harder to learn and implement than high-level languages
- B
High-level languages are harder to learn because they use English phrases
- C
Both types have the same learning difficulty because they use identical syntax
- D
Low-level languages are easier because they require no understanding of hardware
Correct answer
ALow-level languages are harder to learn and implement than high-level languages
Explanation
Low-level languages are difficult to learn and implement, while high-level languages are easier for programmers to learn and use.
- A
- 58
What is a language translator?
- A
A program that converts computer output into spoken English
- B
A program that converts source code into machine code for computer execution
- C
A program that stores source code without changing or executing it
- D
A program that converts machine code into electrical hardware components
Correct answer
BA program that converts source code into machine code for computer execution
Explanation
Language translators, also called translators or language processors, convert source code written in another language into machine or object code.
- A
- 59
Why were language translators developed?
- A
Computers needed programs that could operate without source code
- B
Programmers wanted to make binary code more difficult to understand
- C
Programmers needed easier languages whose code computers could still execute
- D
Computers needed to stop using machine language altogether
Correct answer
CProgrammers needed easier languages whose code computers could still execute
Explanation
Because writing long and complex programs directly in binary was impractical, easier languages were developed and translators converted them into machine code.
- A
- 60
Which three types of language translators are identified?
- A
Compiler, algorithm, and syntax analyzer
- B
Interpreter, mnemonic, and semantic processor
- C
Assembler, compiler, and interpreter
- D
Assembler, database manager, and graphical editor
Correct answer
CAssembler, compiler, and interpreter
Explanation
The three main types of language translators are assemblers, compilers, and interpreters.
- A
- 61
What does an assembler convert?
- A
Machine-language object code into English-language instructions
- B
High-level source code into assembly-language source code
- C
Assembly-language source code into machine-language object code
- D
Database commands into graphical user-interface designs
Correct answer
CAssembly-language source code into machine-language object code
Explanation
An assembler translates assembly-language source code into machine-language object code that the processor can execute.
- A
- 62
What is the result of assembly code after it is processed by an assembler?
- A
English-language instructions that require another assembler
- B
Machine-language object code that can be directly executed by the processor
- C
High-level source code that cannot interact with the processor
- D
A database report that must be interpreted by a web browser
Correct answer
BMachine-language object code that can be directly executed by the processor
Explanation
The assembler produces machine-language object code, which can be directly executed by the processor.
- A
- 63
What does a compiler generally translate?
- A
Database records into binary hardware signals without source code
- B
Machine code into assembly mnemonics during execution
- C
High-level source code into machine code
- D
Assembly code into English phrases for programmers
Correct answer
CHigh-level source code into machine code
Explanation
A compiler is a language translator that generally converts high-level source code into machine code.
- A
- 64
How does a compiler process a program?
- A
It translates only the first statement and then permanently stops
- B
It scans and translates the entire program as a whole
- C
It translates each statement only after the processor executes it
- D
It converts the program into English before checking its syntax
Correct answer
BIt scans and translates the entire program as a whole
Explanation
A compiler scans the entire program and translates it into machine code as a whole.
- A
- 65
Why does a compiled program generally take less time to execute than an interpreted program?
- A
The compiler translates each statement repeatedly during execution
- B
The compiler translates the entire program before execution
- C
The compiler allows the processor to execute English phrases directly
- D
The compiler avoids producing any machine code
Correct answer
BThe compiler translates the entire program before execution
Explanation
Because compilation translates the whole program before execution, the program does not need statement-by-statement translation while running.
- A
- 66
When does a compiler generally generate error messages?
- A
Immediately after reading the first statement
- B
Before receiving any source code from the programmer
- C
Only after the processor has executed every statement
- D
After scanning the entire program
Correct answer
DAfter scanning the entire program
Explanation
The content states that a compiler generates error messages after scanning the whole program.
- A
- 67
How does an interpreter translate a program?
- A
It translates machine code back into a high-level language
- B
It translates the entire program into object code before reading statements
- C
It translates only comments and ignores executable instructions
- D
It translates the program statement by statement
Correct answer
DIt translates the program statement by statement
Explanation
An interpreter converts source code into machine code one statement at a time.
- A
- 68
What happens when an interpreter encounters an error?
- A
It stops execution when it reaches the first error
- B
It continues execution and reports all errors only after completion
- C
It automatically converts the erroneous statement into assembly code
- D
It ignores the error and executes the remaining statements unchanged
Correct answer
AIt stops execution when it reaches the first error
Explanation
An interpreter translates until the first error is encountered and then stops execution.
- A
- 69
Which languages are identified as using compilers?
- A
SQL and NATURAL
- B
C and C++
- C
Python and Ruby
- D
OPS5 and MERCURY
Correct answer
BC and C++
Explanation
The content states that C and C++ use compilers.
- A
- 70
Which languages are identified as using interpreters?
- A
Python and Ruby
- B
FORTRAN and COBOL
- C
C and C++
- D
SQL and LANSA
Correct answer
APython and Ruby
Explanation
The content states that Python and Ruby use interpreters.
- A

Ask anything
We've read this whole study set, so questions about it get the best answers.