QCM : Introduction to Computer Programming — 21 questions

Questions et réponses du QCM

1. What does Unit 1 require students to do with code?

Read, write, and compile code during lectures
Write and compile code during laboratory sessions
Write and compile no code in the unit
Complete programming exercises outside lecture time

Write and compile no code in the unit

Explication

Unit 1 consists of two hours of lecture and has no laboratory work, so students write and compile no code in this unit.

2. What is the scheduled format of Unit 1?

Two hours of lecture with no laboratory work
Two hours of laboratory work with no lecture
One hour of lecture and one hour of laboratory work
One hour of lecture followed by independent coding

Two hours of lecture with no laboratory work

Explication

Unit 1 is a two-hour lecture with two hours of lecture time and no laboratory work.

3. Which description best defines a computer?

A program containing every possible computer command
A machine that stores data and follows instructions on it
A device that guesses the best action from incomplete instructions
A person who decides how data should be used

A machine that stores data and follows instructions on it

Explication

A computer stores data and carries out instructions on that data exactly as given. Judgment and decisions are supplied by a person, not the computer itself.

4. What distinguishes a program from an instruction?

A program is hardware, while an instruction is software
A program is a complete set of instructions for one job, while an instruction is one command within it
A program is one command, while an instruction is a complete task
A program makes decisions, while an instruction stores data

A program is a complete set of instructions for one job, while an instruction is one command within it

Explication

A program is a complete set of instructions that performs one job, whereas an instruction is a single command within that program.

5. What happens when a computer encounters an instruction with no single definite meaning?

It cannot determine the meaning through guessing
It asks the programmer to clarify the instruction
It guesses the most likely intended meaning
It ignores the instruction and continues automatically

It cannot determine the meaning through guessing

Explication

Computers obey instructions literally and do not guess when an instruction lacks one definite meaning.

6. Who is accountable for an instruction that a computer carries out, including an omitted instruction that should have handled a case?

The computer, because it performed the action
The programmer, because the programmer is responsible for the instructions
The operating system, because it manages other programs
The user, because the user operated the computer

The programmer, because the programmer is responsible for the instructions

Explication

The programmer is accountable for every instruction the computer carries out, including instructions that were omitted or failed to handle a situation.

7. A program manages memory, files, devices, and processor sharing rather than helping a user write or browse. What type of program is it?

A user instruction
A data file
An application program
A system program

A system program

Explication

A system program keeps the computer working by managing resources such as memory, files, devices, and processor sharing. An application program serves a user's task.

8. Which task is most clearly performed by an application program?

Writing a document for the user
Sharing processor time among programs
Managing the computer's memory
Organizing access to hardware devices

Writing a document for the user

Explication

Application programs perform jobs wanted by users, such as writing, browsing, or computing a grade. Resource management is the role of system programs.

9. What is the primary role of an operating system?

To issue personal judgments about how programs should operate
To replace every application program on the computer
To provide a single user task such as writing or browsing
To serve as the main system program that shares resources among other programs

To serve as the main system program that shares resources among other programs

Explication

An operating system is the main system program that shares memory, processor time, and files among other programs.

10. Which statement correctly defines the binary number system?

It uses only even-numbered digits
It uses the digits 0 and 1
It uses the digits 0 through 9
It uses letters and numerals together

It uses the digits 0 and 1

Explication

Binary is a number system that uses only 0 and 1. Decimal, by contrast, uses the digits 0 through 9.

11. Why can a processor execute machine language directly?

It stores all commands as decimal numbers
Its instructions are written in English
Its instructions are written in binary
It automatically translates every high-level statement

Its instructions are written in binary

Explication

Machine language consists of binary instructions, which are the only language form the processor can execute directly.

12. What decimal value does the binary number 1011 represent?

13
11
10
9

11

Explication

The 1s occupy the 8, 2, and 1 positions, so 8 + 2 + 1 = 11. The 0 in the 4 position contributes nothing.

13. What distinguishes assembly language from machine language?

Assembly uses readable paragraphs, while machine language uses decimal
Assembly represents several machine steps per line, while machine language uses English
Assembly runs without a processor, while machine language requires one
Assembly uses short command words, while machine language uses binary

Assembly uses short command words, while machine language uses binary

Explication

Assembly language expresses machine instructions with short words such as LOAD, ADD, and STORE. Machine language expresses those instructions directly in binary.

14. Why are high-level languages generally more convenient for programmers than lower-level languages?

They eliminate the need for any translation
Each line corresponds to exactly one machine step
They are written directly as processor binary
A readable line can represent many machine steps

A readable line can represent many machine steps

Explication

High-level languages are designed for programmer convenience, and one readable line can represent many machine steps.

15. Which sequence correctly orders the three language levels from closest to the processor to closest to the programmer?

Assembly language, machine language, high-level language
High-level language, assembly language, machine language
Machine language, high-level language, assembly language
Machine language, assembly language, high-level language

Machine language, assembly language, high-level language

Explication

Machine-level code is binary and closest to the processor, assembly uses short words for individual machine steps, and high-level code uses readable statements for multiple steps.

16. What is the primary function of a translator in programming?

To design readable commands for programmers
To execute machine instructions without changing them
To store a program permanently in processor memory
To convert source code from one language into another

To convert source code from one language into another

Explication

A translator is a program that turns source written in one language into another language. Direct execution is performed by the processor only for machine language.

17. What happens before a compiled program runs?

The source remains unchanged and is executed as written
Each instruction is translated only when the processor reaches it
The program is converted into short assembly words without creating a file
The whole source file is translated into machine-ready form and saved

The whole source file is translated into machine-ready form and saved

Explication

A compiler translates the entire source file before execution and produces a machine-code file saved on disk. Translating during execution describes interpretation.

18. How does an interpreter process a program?

It checks every instruction only after the program has finished
It translates and executes one instruction at a time while the program runs
It converts source code into binary without executing it
It translates the entire file before execution and saves machine code

It translates and executes one instruction at a time while the program runs

Explication

An interpreter translates and carries out source code one instruction at a time during execution, without saving a translated file.

19. Which statement best compares compilation with interpretation?

Both translate only one line at a time, but compilation saves no output
Compilation starts more slowly but runs faster, while interpretation starts immediately and translates during execution
Both translate the whole file first, but interpretation produces a machine-code file
Compilation starts immediately but runs slower, while interpretation checks the whole file before execution

Compilation starts more slowly but runs faster, while interpretation starts immediately and translates during execution

Explication

Compilation has a slower start because it processes the whole file, but the resulting program runs faster and is checked before execution. Interpretation starts immediately but translates during execution, revealing errors when their lines are reached.

20. Which revision makes the instruction “Display PASSED if the grade is good enough” executable?

Display PASSED when the teacher considers the grade satisfactory
Display PASSED when the grade is relatively high compared with others
Display PASSED when the grade is 75 or more, and FAILED otherwise
Display PASSED when the grade seems acceptable to the student

Display PASSED when the grade is 75 or more, and FAILED otherwise

Explication

An executable instruction replaces vague judgments with an exact condition and specifies the output for each case. “The grade is 75 or more” is precise, while “good enough” is ambiguous.

21. Why is “the grade is 75 or more” preferable to “the grade is good enough” in an instruction?

It allows different people to interpret the result according to context
It describes the student’s overall academic performance more broadly
It avoids requiring a separate output for grades below the threshold
It defines a precise condition that can determine the required output

It defines a precise condition that can determine the required output

Explication

The condition “75 or more” gives an unambiguous rule that can be executed consistently, whereas “good enough” depends on subjective interpretation.

Révisez avec les flashcards

Mémorisez les réponses avec 38 flashcards sur Introduction to Computer Programming.

How long is the lecture time in Unit 1?

Two hours of lecture time.

Does Unit 1 include any laboratory work?

No, it includes no laboratory work.

Do students write or compile code in Unit 1?

No, students write and compile no code in Unit 1.

Voir les flashcards →

Approfondir avec la fiche

Consultez la fiche de révision complète sur Introduction to Computer Programming.

Voir la fiche →

Cours similaires

Crée tes propres QCM

Importe ton cours et l'IA génère des QCM avec corrections en 30 secondes.

Générateur de QCM