C++ PYQ Answers
C++ PYQ Answers
Ans-Algorithms and flowcharts are different mechanisms used for designing different programs, particularly in
computer programming. An algorithm is a step-by-step summary of the procedure, while on the other hand, a
flowchart illustrates the steps of a program graphically.
Ans-A structure chart is a visual representation of a system's logical processes or breakdown into its lowest
manageable levels. It's a common tool in structured design and software engineering, and is also known as a
hierarchy chart.
Ans- Gray code is a type of binary code that uses a different method of incrementing from one number to the
next. In Gray code, only one bit changes state from one position to another, which allows for error checking. For
example, if more than one bit changes, the data must be incorrect. Gray code is also known as reflected binary
code.
Ans-Cache memory is a temporary chip-based memory feature in a computer that allows for faster access to
information. It's a high-speed buffer between the CPU and the main memory that stores data and instructions
that are frequently accessed or likely to be reused. When a task requires information that's stored in the cache,
the computer checks the cache first. If the data is there, it's called a "hit" and the computer achieves peak
performance. If the data isn't there, it's called a "miss" and the computer has to look for the information in the
hard drive or RAM, which is slower.
Ans- A distributed operating system (DOS) is a system software that connects multiple computer systems through
a single communication channel and coordinates their operation. Each system in a DOS has its own processors
and memory, and the processors communicate over high-speed buses or telephone lines. The goal of a DOS is to
integrate multiple resources and processing functionality into an efficient and stable system.
Ans- Recursion is the process a procedure goes through when one of the steps of the procedure involves invoking
the procedure itself. A procedure that goes through recursion is said to be 'recursive'. To understand recursion,
one must recognize the distinction between a procedure and the running of a procedure.
7. What is pure virtual function?
Ans- A pure virtual function or pure virtual method is a virtual function that is required to be implemented by a
derived class if the derived class is not abstract. Classes containing pure virtual methods are termed "abstract"
and they cannot be instantiated directly.
Ans- In C++ programming, identifiers are the names assigned to different entities such as variables, functions,
arrays, etc. Here's a simple code example: int score = 90; In this case, 'score' is an identifier that we've used to
name our integer variable.
Ans- An overloaded function is really just a set of different functions that happen to have the same name. For any
particular call, the compiler determines which overloaded function to use, and resolves this at compile time. This
is true for programming languages such as C++.
Ans- An abstract class is a class that contains abstract methods that are not implemented, and therefore cannot
be instantiated directly. However, subclasses that extend the abstract class can be created, and these subclasses
can provide implementations for the abstract methods.