Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Programming Concepts and C++

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What are the main characteristics of programming?

a)

The main characteristics of programming are syntax, semantics, abstraction, modularity, and efficiency.

b)

Efficiency is only about speed

c)

Modularity is not important in programming

d)

Syntax and semantics are the same

2.

List and describe two types of programming methodologies.

a)

1. Agile: An iterative methodology focusing on flexibility and customer feedback. 2. Waterfall: A linear methodology where each phase is completed sequentially.

b)

Scrum: A methodology focused on long-term planning and documentation.

c)

DevOps: A methodology that prioritizes hardware over software development.

d)

Spiral: A methodology that emphasizes a single, fixed sequence of development phases.

3.

What are the four main principles of Object-Oriented Programming (OOP)?

a)

Polymorphism, Composition, Inheritance, Reflection

b)

Composition, Aggregation, Delegation, Interface

c)

Inheritance, Overloading, Encapsulation, Serialization

d)

Encapsulation, Abstraction, Inheritance, Polymorphism

4.

How does Procedure-Oriented Programming differ from Object-Oriented Programming?

a)

POP emphasizes procedures and functions, while OOP emphasizes objects that encapsulate data and behavior.

b)

OOP uses global variables extensively, while POP does not.

c)

POP focuses on data structures, while OOP focuses on algorithms.

d)

POP is only used in web development, while OOP is used in desktop applications.

5.

What are the advantages of using Object-Oriented Programming?

a)

Encapsulation, inheritance, polymorphism, and improved maintainability.

b)

Simplified data storage methods

c)

Code reusability through functions

d)

Faster execution speed

6.

Explain the structure of a basic C++ program.

a)

A basic C++ program structure includes preprocessor directives, the main function, statements, and a return statement.

b)

A basic C++ program consists only of comments and whitespace.

c)

A C++ program must include a graphics library to run.

d)

The main function is optional in a C++ program structure.

7.

What are tokens in C++ and why are they important?

a)

Tokens are only used for variable declarations.

b)

Tokens are only relevant in object-oriented programming.

c)

Tokens in C++ are the smallest elements of a program, crucial for code parsing and compilation.

d)

Tokens are the same as keywords in C++.

8.

Describe the purpose of the scope resolution operator in C++.

a)

The scope resolution operator allows access to global scope and disambiguates names in different scopes.

b)

The scope resolution operator is a tool for defining new data types.

c)

The scope resolution operator is used to create inline functions.

d)

The scope resolution operator is used for memory management in C++.

9.

What is the difference between 'break' and 'continue' in loops?

a)

'break' continues the loop; 'continue' exits the loop entirely.

b)

Both 'break' and 'continue' exit the loop but in different ways.

c)

'break' skips to the next iteration; 'continue' exits the loop.

d)

'break' exits the loop; 'continue' skips to the next iteration.

10.

How do you perform type conversion in C++?

a)

Using string concatenation for type conversion

b)

Using only printf for conversion

c)

Type conversion in C++ can be performed using implicit conversion, explicit casting (static_cast, dynamic_cast, const_cast, reinterpret_cast), or user-defined conversion operators.

d)

Declaring variables without types