QCM : Fundamentals of Programming and Software Development — 9 questions

Questions et réponses du QCM

1. What is a function in programming?

A reusable piece of code that is part of an object and operates on its data
A sequence of instructions that performs a task without accepting input parameters
A block of code that performs a specific task without returning a value
A block of code that performs a specific task and returns a value

A block of code that performs a specific task and returns a value

Explication

A function is a block of code designed to perform a specific task, accept input parameters, and return a value, as explicitly defined in the course content.

2. Which control structure is described as a statement that selects one of many code blocks to execute based on the value of an expression, and was specifically cited as being explained in 2017?

Loops
Switch case
Conditional statements
Branching

Switch case

Explication

The 'Switch case' control statement is explicitly mentioned in the content as a structure that selects among many code blocks based on an expression's value, with a citation from 2017, making it the correct answer.

3. What is the primary role of variables in programming?

To perform calculations without storing data
To serve as named storage locations for data that can change during program execution
To execute a sequence of instructions in a program
To define the structure of a program's user interface

To serve as named storage locations for data that can change during program execution

Explication

Variables act as named storage locations that hold data which can change during program execution, enabling programs to manipulate and process data dynamically.

4. When was the concept of functions and procedures formally established or published in the context of programming?

1968
1978
1986
1972

1968

Explication

The concept of functions and procedures was formally established and gained widespread recognition with the publication of influential work on structured programming by Edsger Dijkstra in 1968, which emphasized modularity and the use of functions and procedures.

5. How do a class and an object differ in object-oriented programming?

An object defines the structure of a class, while a class is an object in memory.
A class is a blueprint for creating objects, while an object is an instance of a class.
A class is an object created at runtime, while an object is a static template.
A class and an object are identical; the terms are interchangeable.

A class is a blueprint for creating objects, while an object is an instance of a class.

Explication

A class serves as a blueprint or template for creating objects, which are specific instances of that class. This fundamental distinction is key to understanding object-oriented programming.

6. Who is credited with proposing the concept of the stack data structure?

Dennis Ritchie
Kernighan and Ritchie
Edsger Dijkstra
Alan Turing

Edsger Dijkstra

Explication

Edsger Dijkstra is credited with formalizing the concept of the stack data structure, which is fundamental in programming for managing function calls and recursion.

7. What is a common consequence of improper file handling in programming?

Data corruption or loss due to not closing files properly
Increased program speed and efficiency
Improved readability of code
Enhanced security of stored data

Data corruption or loss due to not closing files properly

Explication

Improper file handling, such as failing to close files after operations, can lead to data corruption or loss because data may not be written properly or resources may not be released, causing errors and unreliable data storage.

8. How can a programmer effectively use breakpoints during debugging to identify errors in their code?

Use automated testing tools to generate reports about code errors.
Run the program multiple times with different inputs to see when errors occur.
Write additional print statements throughout the code to track variable values.
Set breakpoints at suspected error locations and step through code to observe variable states.

Set breakpoints at suspected error locations and step through code to observe variable states.

Explication

Setting breakpoints at suspected error locations allows the programmer to pause execution and step through the code, observing variable states and program flow, which helps identify the source of errors efficiently.

9. What is a key feature of the Software Development Life Cycle?

It is a systematic, phased approach guiding software development.
It involves only coding and testing phases without planning.
It focuses solely on maintenance after deployment.
It is an unstructured process that develops software randomly.

It is a systematic, phased approach guiding software development.

Explication

The key feature of SDLC is that it is a systematic, phased approach that guides the entire software development process from requirements to maintenance, ensuring organized and efficient development.

Révisez avec les flashcards

Mémorisez les réponses avec 18 flashcards sur Fundamentals of Programming and Software Development.

Algorithm — definition?

A step-by-step problem-solving procedure.

Syntax — role?

Defines language structure and rules.

Programming Language — purpose?

Communicates instructions to a computer.

Voir les flashcards →

Approfondir avec la fiche

Consultez la fiche de révision complète sur Fundamentals of Programming and Software Development.

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