Quiz: Introduction to Computer Programming — 11 domande

Domande e risposte dettagliate

1. What is the primary role of a computer in relation to data and instructions?

It decides which instructions are most sensible to follow
It supplies the judgment behind every instruction
It rewrites unclear instructions into complete programs
It stores data and carries out instructions exactly as given

It stores data and carries out instructions exactly as given

Spiegazione

A computer stores data and executes instructions exactly as they are provided. Human judgment and decisions come from the person supplying the instructions.

2. What is a computer in the context of programming?

A device that only stores data without processing it
A network device that connects multiple computers
A person who writes code for software applications
A machine that stores data and executes instructions exactly as given

A machine that stores data and executes instructions exactly as given

Spiegazione

A computer is defined as a machine that stores data and carries out instructions on it exactly as given, which is fundamental to understanding programming.

3. Which statement best distinguishes a program from an individual instruction?

A program is the data that a computer stores during execution
A program is a complete set of instructions for one job
A program is a single command within a larger instruction
A program is the person responsible for choosing commands

A program is a complete set of instructions for one job

Spiegazione

A program consists of all the instructions needed to tell a computer how to perform one job. An instruction is just one command within that program.

4. What is the primary function of a computer as defined in the course outline?

To perform calculations without following instructions
To generate random outputs based on input
To interpret human language and respond accordingly
To store data and execute instructions exactly as given

To store data and execute instructions exactly as given

Spiegazione

A computer is defined as a machine that stores data and carries out instructions on it exactly as given, emphasizing precise execution of commands.

5. A program receives the instruction “charge a fair price” without defining what “fair” means. What must happen before the computer can carry out the instruction?

The instruction must be rewritten with one definite meaning
The computer must infer a reasonable price from the situation
The computer must choose the price used most often by people
The instruction can run unchanged because computers understand context

The instruction must be rewritten with one definite meaning

Spiegazione

A computer can carry out an instruction only when it has one clear, definite meaning. Vague phrases such as “charge a fair price” must therefore be made precise.

6. What is the primary purpose of system programs in a computer system?

To perform user-specific tasks like browsing or writing
To develop new programming languages
To manage hardware resources like memory and devices
To create user interfaces for applications

To manage hardware resources like memory and devices

Spiegazione

System programs are designed to keep the computer functioning properly by managing hardware resources such as memory, files, and devices. Application programs, on the other hand, are meant for user-specific tasks.

7. A canteen program subtracts a 35-peso price from a 30-peso payment and displays −5. What does this result show?

The computer guessed incorrectly how to handle insufficient payment
The computer failed because negative numbers cannot be displayed
The computer changed the price before performing the subtraction
The computer performed the written subtraction correctly

The computer performed the written subtraction correctly

Spiegazione

The computer correctly followed the written subtraction instruction, producing −5. The programming failure was the omission of instructions for handling insufficient payment.

8. When was the concept of binary and machine language established as the fundamental way computers understand instructions?

In the 1960s with the advent of high-level programming languages
In the 1980s with the rise of personal computers
In the 1940s during the development of early computers
In the 2000s with modern computing advancements

In the 1940s during the development of early computers

Spiegazione

Binary and machine language were established as the fundamental way computers understand instructions during the 1940s, with the development of early computers like the ENIAC and the first stored-program computers.

9. How do assembly language and high-level programming languages differ in their representation of machine instructions?

Assembly language is only used for low-level hardware programming, while high-level languages are used for application development.
Assembly language is written in binary, whereas high-level languages are written in machine code.
Assembly language uses short words for each machine step, while high-level languages use readable statements that require translation.
Assembly language is interpreted during execution, while high-level languages are compiled before execution.

Assembly language uses short words for each machine step, while high-level languages use readable statements that require translation.

Spiegazione

Assembly language expresses machine instructions as short words, making it easier for humans to read and write, whereas high-level languages use more readable statements that need translation into machine code.

10. Who is credited with the development of the concept of three programming language levels, including assembly, high-level, and machine language?

John Backus
Ada Lovelace
Dennis Ritchie
Grace Hopper

John Backus

Spiegazione

John Backus is credited with the development of the concept of three programming language levels, especially through his work on assembly language and high-level languages like FORTRAN.

11. What is a primary cause for choosing between compilation and interpretation paths in programming?

The preference for translating code during runtime favors compilation.
The need for faster program execution favors interpretation.
The desire to run code on multiple platforms favors interpretation.
The requirement for early error detection favors compilation.

The requirement for early error detection favors compilation.

Spiegazione

Compilation is chosen mainly because it checks the entire source for errors before execution, enabling faster runtime. Interpretation translates code during execution, which is faster to start but slower overall.

Ripassa con le flashcard

Memorizza le risposte con 11 flashcard su Introduction to Computer Programming.

What is a computer?

A machine that stores data and carries out instructions exactly as given.

Computer Definition

Machine that stores and executes instructions.

Who is a programmer?

The person who decides instructions and is answerable for their actions.

Vedi le flashcard →

Studia la scheda di revisione

Leggi la scheda di revisione completa su Introduction to Computer Programming.

Vedi la scheda di revisione →

Similar courses

Crea i tuoi quiz

Importa il tuo corso e l'AI genera quiz con correzioni in 30 secondi.

Generatore di quiz