- Type
- Final term past paper
- Course
- CS201 Introduction to Programming
- Size
- PDF 758 KB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extensionSign in with the extension for 30 a day.
Preview text
Text from pages 1, 2, 3 of 13. Download the file for all 13 pages.
Macros with the #define directive. Micro is a special name, which is substituted in the code by its definition and as a result, we get an expanded code.
#define PI 3.1415926
Directive:
Directive is a language construct that specifies how a compiler should process its input
Macro:
Macro is a fragment of code which has been given a name.
Memory Allocation:
Memory allocation refers to performing manual memory management for dynamic memory allocation in the C programming language via a group of functions in the C standard library realloc, calloc etc.
Dangling Pointers:
Dangling pointer occurs at the time of the object destruction when the object is deleted or de-allocated from memory without modifying the value of the pointer.
History of C/C++:
C language was developed by scientists of Bell Labs in 1970s. It is very lean and mean language, very concise but with lot of power. C conquered the programming world and took it by storm. Major operating systems e.g., Unix was written in C language.
Structured programming:
C is called structured modular programming language because while solving large and complex problem, C programming language divides the problem into smaller modules called functions.
Inline functions:
This is also one of the facilities provided by C++ over C. In our previous lectures, we discussed and wrote macros few macros like max and circlearea. Inline functions also work more or less in the same manner as macros.
Q1. What is OOP(Object Oriented Programming)
Answer: Object Oriented Programming is a computer programming model that organizes software around data or subject rather than features or logic. An object can be defined as a data that has a unique attribute and behavior
Q2. What is Core?
Answer: The core of the pure object oriented programming is to create an object. In code, that has certain properties and method.
Q3. What is class?
Answer: A class is a user defined data type, which holds its own data members and member functions, which can be accessed and used by creating an instance of that class
E.g: Consider the class of Cars
Q4. How many types of class?
Answer: There are two types of classes
- Abstract classes
- Concrete Classes
Q5. What is Abstract Classes?
Answer: Not object is made, Only inheritance can be used that have abstract and concrete methods, real words existence are not found. Abstract class can not be instantiated using new keyword. Abstract class may or may not have abstract method
Q6. What is concrete methods?
Answer: Object is made and used, derived and child classes from abstract classes , real words existence are found. Concrete class can be instantiated using new keyword. Concrete class can not have an abstract method
Q7. What is abstraction or Information hiding?
Answer: Data abstraction refers to provide essential information to the outside the world but hide their background details. i.e to represent the information needed to the program without presentation the details
For Example: The data base system hides detials how data is stored and created and maintained.
Q8. What is Encapsulation?
Answer: Encapsulation is placing the data and function work on that data in the same place. Only works with procedural languages.
It is not always clear which works on which variables but object oriented programming provides you framework to place the data that works together in the same object.
Q9. What is inheritance?
Answer: One of the most useful aspects of object oriented programming is code reusability. Inheritance is the process of forming a new class from an existing class that is:
New class is called as derived class and Existing class is called as base class.
Related CS201 files
All CS201 files →- CS201 Final Term Past Papers Set 2 by VU Stars Final term PDF 4.4 MB
- CS201 Final Term Important Topics by VUBuddy Final term PDF 346 KB
- CS201 Final Term Solved Papers by Waqar Siddhu and Team Hadi Final term RAR 21.3 MB
- CS201 Final Term Solved Subjective by Moaaz Final term PDF 505 KB
- CS201 Complete Handouts Handout PDF 3.4 MB
- CS201 Short Notes Set 2 by Ameer Hamza Quiz PDF 977 KB
Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.