CS201 Final Term Notes 2 By VU Learning.pdf
Verified academic study resource for CS201 (Introduction to Programming) under the Computer Science at Virtual University of Pakistan. This PDF document (Final-Term Solved Past Paper & Examination Pack) covers Final-Term Exam Scope (Lectures 23 to 45) spanning approximately 320 pages across 4 curriculum modules, and is indexed for student examination review with instant in-browser preview and 100% free direct download.
- Course
- CS201 – Introduction to Programming
- Faculty
- Computer Science
- Format
- Type
- Final-Term
- Coverage
- Final-Term Exam Scope (Lectures 23 to 45)
- Tags
- FINALTERM
Virtual University regulations strictly require achieving at least 20% marks in the Final-Term exam paper alone (typically 12+ marks out of 60) to pass CS201, regardless of midterm scores.
What this file covers — CS201 syllabus roadmap
- Object-Oriented Paradigms: Classes & Data Abstraction — Lectures 23 to 29 (Pages 281 to 360). 16% Final-Term Marks (Core OO Concepts)
- Inheritance Hierarchies & Dynamic Polymorphism — Lectures 30 to 36 (Pages 361 to 435). 20% Final-Term Marks (Virtual Functions & V-Tables)
- Templates, Standard Library & Persistent File I/O — Lectures 37 to 41 (Pages 436 to 510). 14% Final-Term Marks (Generic Code & Streams)
- Final-Term Examination Dossier & Capstone Synthesis — Lectures 42 to 45 (Pages 511 to 585). Final-Term Exam Synthesis (Lectures 23–45 Scope)
Frequently asked questions
Where can I download CS201 Final Term Notes 2 By VU Learning.pdf for free?
You can preview and download "CS201 Final Term Notes 2 By VU Learning.pdf" (CS201 PDF, ~320 pages) directly from the MIHORA VU Study Library (https://study.mihora.tech/doc/cs201-final-term-notes-2-by-vu-learning-pdf-2) with 100% free high-speed downloads and zero registration requirements.
What syllabus chapters and lectures are covered in this CS201 file?
This document covers Final-Term Exam Scope (Lectures 23 to 45) across 4 distinct lecture units (Lectures 23 to 29, Lectures 30 to 36, Lectures 37 to 41, Lectures 42 to 45), featuring comprehensive definitions, solved objective questions, and examiner marking rubrics.
What is the passing criteria for CS201 under the VU 20% Two-Half Rule?
Under official Virtual University regulations, students must score at least 20% in the First Half (Quizzes, Assignments, GDBs, and Midterm combined) AND independently at least 20% in the Final-Term examination paper. Scoring under 20% in the final exam results in an automatic F grade regardless of earlier marks.
Are CS201 solved past papers and handouts verified for 2026 exams?
Yes. All CS201 materials on MIHORA VU—including Moaaz, Waqar Siddhu, and team archives—are reviewed against the current VU syllabus to help students prepare for 2026 Midterm, Final-Term, and online quiz examinations.
Inside this file
CS201 Notes for Final Term (Lecture#39-45)
Preparation
Prepared By VU Learning
Video Link: https://youtu.be/XzxLnuSRUMA
Lecture No. 39:
Pointers: Pointer is a special type of variable that contains a memory address. It is
not a variable that contains a value, rather an address of the memory that is
contained inside a pointer variable.
The & operator is used to get the address of a variable or an object. The & sign is
also used as a short hand for a reference.
Reference: A reference can be considered as a special type of pointer as it also
contains memory address.
Difference: Pointers may point to nothing while references always have to point to
something. The references used when we are implementing the call by reference &
we can implement the call by reference without using the * operator.
Call by Value: We call a function and pass an argument, an object or variable to
the function. Original data remains at its place and a temporary copy of it is made
and passed to the function. Whatever the function does with this copy, the original
value, in the calling function, remains intact. This is a call by value.
Call by Reference: If we want a function to change something in the original
object variable or whatever, then that variable or object by reference would be
passed. To do this, we don’t make temporary copy of that object or variable.
Rather, the address of the variable is sent. When the function manipulates it, the
original object will be manipulated, effecting change in its values.
Which one is Efficient?
The use of call by reference is also important for the sake of efficiency. If we have
a large object, sending of its copy will be something insufficient. It will occupy a
large space on the stack. Here, we can use call by reference instead of call by value
only for efficiency while we need not to change the original object. For this, we
use a keyword const that means that a const (constant) reference is being passed.
The function can use its values but cannot change it.
In static memory allocation, whenever we declare an array, we have to mention its
size. It is necessary, as otherwise no memory will be allocated.
We do initialization as
int i = 0 ;
OR
int i ;
i=0;
The default assignment of C will carry out. ( If we have not defined the overloaded
operator for Assignment). The default assignment is a member-to-member
assignment.
A copy constructor is a special constructor for creating a new object as a copy of
an existing object. Constructor that will create a new object with a full copy of the
other object. This is also known as deep copy as opposed to shallow copy.
Rules for Using Dynamic Memory Allocation:
1) First, we must define a constructor for it. Otherwise, we will not be able to
carry out dynamic memory allocation.
2) Secondly, we must write an assignment operator for that class. This
assignment operator should first check the self-assignment and then make a
deep copy.
3) Thirdly, as we are doing dynamic memory allocation in the constructor, it is
necessary to provide a destructor. This destructor should free the allocated
memory.
Matrix m2 = m1 ; It is not an assignment operator. It is a copy constructor.
Lecture No. 40:
A class is a user defined data type and it can be used
inside other classes in the same way as native data types are used. Thus we can
create classes that contain objects of other classes as data members.
Construction of an object is that the contained data members of the object are
constructed before the object itself.
The order of the execution of initializes is the same as the order of declarations of
objects inside the outer class.
The default scope for members of structures is public whereas the default visibility
for class members is private.
A class can contain instances of other classes as its data members.
• It is a way of reusing the code when we contain objects of our already written
classes into a new class.
The order of destruction of an object is reverse to this construction order, where the
outer object is destroyed first before the inner data members.
• Initializes list is used to initialize the inner objects at the construction time.
Classes defined within other classes are called nested classes.
Lecture No.41:
A template is a sketch to draw some shape or figure. Template is allowing us the
reuse of a certain shape/code.
For normal code, you would use a class template when you want to create
a class that is parameterized by a type, and a function template when you want to
create a function that can operate on many different types.
Macro is a code substitution while #define is a value substitution.
Lecture No. 42:
Static variable members are used to define ordinary classes. The static variable has
a single copy for the whole class. So there are not separate copies of the static data
variable for each object like ordinary data members.
Advantages and Disadvantages of Templates:
Advantages:
❖ Templates are easier to write than writing several versions of your similar
code for different types
❖ Templates can be easier to understand, since they can provide a
straightforward way of abstracting type information.
❖ Templates are type-safe. This is because the types that templates act upon
are known at compile time, so the compiler can perform type checking
before errors occur.
❖ Templates help in utilizing compiler optimizations to the extreme.
Disadvantages:
If misused of templates then:
❖ Templates can make code difficult to read and follow depending upon
coding style.
❖ They can present seriously confusing syntactical problems esp. when the
code is large and spread over several header and source files.
❖ Then, there are times, when templates can "excellently" produce nearlyMore CS201 files
- CS201 (Final term Notes) Important Topics Covered 2025.pdf (PDF · Final-Term)
- CS201 2 Quiz#3 6 July2023 FINALS by MISS MEHWISH.pdf (PDF · Final-Term)
- CS201 2 Quiz#3 6 July2023 FINALS by MISS MEHWISH.pdf (PDF · Final-Term)
- CS201 2020 Final Paper Current by VU Answer-1.pdf (PDF · Final-Term)
- CS201 2020 Final Paper Current by VU Answer-1.pdf (PDF · Final-Term)
- CS201 2020 Final Paper Current by VU Answer.pdf (PDF · Final-Term)
- CS201 2020 Final Paper Current by VU Answer.pdf (PDF · Final-Term)
- CS201 2020 Final Paper Current by VU Answer.pdf (PDF · Final-Term)