QCM : Fundamentals of Programming and Software Design — 7 questions

Questions et réponses du QCM

1. Which programming language is explicitly mentioned as being dynamically typed, meaning variables do not need explicit type declarations?

JavaScript
Python
Java
C++

Python

Explication

Python is explicitly mentioned as a dynamically typed language, where variables do not require explicit type declarations and their types are determined at runtime, which is a key characteristic of Python.

2. What is the primary purpose of a variable in programming?

To store data that can change during program execution
To define a fixed value that cannot be altered
To specify the data type of a value
To control the flow of a program

To store data that can change during program execution

Explication

Variables are used to store data that can be modified as the program runs, which makes them essential for dynamic data handling. Fixed values are constants, not variables.

3. What is the primary role of control structures in programming?

To define the structure and organization of code modules
To handle errors and exceptions during runtime
To manage the flow of execution based on conditions or repetitions
To store data temporarily during program execution

To manage the flow of execution based on conditions or repetitions

Explication

Control structures are used to manage the flow of execution in a program, allowing decisions and repetitions, which are essential for dynamic behavior.

4. Which data type would you typically use to store a person's name in a program?

String
Integer
Boolean
Float

String

Explication

Strings are used to store text such as names, while integers and floats are for numeric values, and booleans are for true/false data.

5. What is a variable in programming?

A set of instructions that perform a specific task
A named storage location in memory that holds data which can be changed during program execution
A sequence of characters used to represent text
A fixed value that cannot be altered once assigned

A named storage location in memory that holds data which can be changed during program execution

Explication

A variable is a named storage location in memory that holds data which can be changed during program execution, as explicitly defined in the context.

6. What is the main difference between an integer and a float data type?

Integers are whole numbers; floats include decimal points
Integers can store text, floats cannot
Floats are used for true/false values, integers are not
Floats are faster to process than integers

Integers are whole numbers; floats include decimal points

Explication

Integers represent whole numbers without decimal parts, whereas floats can represent fractional numbers with decimal points.

7. Why is type conversion important when working with variables?

It allows combining or comparing different data types correctly
It prevents syntax errors
It permanently changes the variable's data type
It automatically optimizes code performance

It allows combining or comparing different data types correctly

Explication

Type conversion allows data of one type to be converted into another, enabling operations like string concatenation with numbers or comparisons across types.

Révisez avec les flashcards

Mémorisez les réponses avec 10 flashcards sur Fundamentals of Programming and Software Design.

Variable — definition?

Named storage in memory for data.

Variable — definition?

Named storage for data in memory.

Data Types — role?

Specify kind of data variables can hold.

Voir les flashcards →

Approfondir avec la fiche

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

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