CS201 Short Note 32 Pages.pdf
Verified academic study resource for CS201 (Introduction to Programming) under the Computer Science at Virtual University of Pakistan. This PDF document (Official Lecture Handouts & Highlighted Notes) covers Complete Course Handouts (Lectures 1 to 45) spanning approximately 450 pages across 8 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
- Handout
- Coverage
- Complete Course Handouts (Lectures 1 to 45)
Virtual University examiners construct 100% of objective MCQs and subjective marking schemes directly from the official CS201 handouts.
What this file covers — CS201 syllabus roadmap
- Core Architecture, Syntax & Primitive Data Structures — Lectures 1 to 6 (Pages 1 to 65). 15% Objective Marks (8–10 MCQs)
- Conditional Branching, Loops & Logical Control Flow — Lectures 7 to 12 (Pages 66 to 140). 18% Exam Marks (MCQs + 2-Mark Short Questions)
- Memory Management, Pointers, Arrays & Functions — Lectures 13 to 18 (Pages 141 to 215). 22% Exam Marks (High Yield for Midterms)
- Midterm Consolidation, Strings & Algorithm Synthesis — Lectures 19 to 22 (Pages 216 to 280). Midterm Exam Culmination (Lectures 1–22 Scope)
- 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 Short Note 32 Pages.pdf for free?
You can preview and download "CS201 Short Note 32 Pages.pdf" (CS201 PDF, ~450 pages) directly from the MIHORA VU Study Library (https://study.mihora.tech/doc/cs201-short-note-32-pages-pdf) with 100% free high-speed downloads and zero registration requirements.
What syllabus chapters and lectures are covered in this CS201 file?
This document covers Complete Course Handouts (Lectures 1 to 45) across 8 distinct lecture units (Lectures 1 to 6, Lectures 7 to 12, Lectures 13 to 18, Lectures 19 to 22, 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 Solved Subjective by Muhammad Ishfaq Page No.1
CS201 Subjective:
Question: What is the use of reference data type?
Answer: A reference data type is a variable that can contain an address. The reference
data types in Java are arrays, classes and interfaces. You'll hear often say that Java does
not have pointers. Yet, you could consider a reference data type to be a pointer
Question: What are the main types of operators in terms of number of arguments
they take?
Answer: The difference is in the number of arguments used by the function. In the case
of binary operator overloading, when the function is a member function then the
number of arguments used by the operator member function is one. When the function
defined for the binary operator overloading is a friend function, then it uses two
arguments.
Question: What is the “this” pointer? Give an example of its use
Answer: In a C++ program, if you create object A of class X, you can then obtain the
address of A by using the "this" pointer. The address is available as a local variable in the
non-static member functions of X, and its type is const X*. The "this" pointer works
because C++ creates instances of its data members, and it keeps one copy of each
member function.
Question: What are manipulators? Give one example.
Answer:Manipulators are operators used in C++ for formatting output. The data is
manipulated by the programmer‟s choice of displayed.
Endl manipulator: This manipulator has the same functionality as the „\n‟ newline
character.
Question:If the requested memory is not available in the system then what does
calloc/malloc and new operator return?
Answer: malloc returns a void pointer to the allocated space or NULL if there is
insufficient memory available. To return a pointer to a type other than void, use a type
cast on the return value. The storage space pointed to by the return value is guaranteed
to be suitably aligned for storage of any type of object. If size is 0, malloc allocates a zero-
length item in the heap and returns a valid pointer to that item.
By default, malloc does not call the new handler routine on failure to allocate memory.
You can override this default behavior so that, when malloc fails to allocate memory,
malloc calls the new handler routine in the same way that the new operator does when it
fails for the same reason.
Question: If we want to send the data by reference and don‟t want that original
data should be affected then what can we do to prevent any change?
Answer: Call by Reference shall be used in that case.
Question: Write down the disadvantages of the templates.
Answer: The disadvantages of templates are:
• Templates can make code difficult to read and follow depending upon coding style.
CS201 Solved Subjective by Muhammad Ishfaq Page No.2
• 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 nearly meaningless
compiler errors thus requiring extra care to enforce syntactical and other design
constraints. A common mistake is the angle bracket problem.
Question: The following code segment has errors. Locate as many as you can and
explain briefly.
Answer:
class Circle // no need to enter colon here ,
{
private : //colon missing
double centerX;
double centerY;
double radius;
public: //colon missing
void setCenter(double, double);
void setRadius(int);
};//semi colon missing
Question ( Marks: 5 )
Write a program which defines three variables of type double which store three different
values including decimal points, using setprecision manipulators to print all these values
with different number of digits after the decimal number.
Answer:
#include <iostream>
#include <iomanip>
int main ()
{
double x1 = 12345624.72345
double x2 = 987654.12345
double x3 = 1985.23456
cout << setprecision (3) << x1<< endl;
cout << setprecision (4) << x2 << endl;
cout << setprecision (5) << x3<< endl;
return 0;
}
Question ( Marks: 3 )
Identify the errors in the following member operator function and also correct
them.
math * operator(math m);
math * operator (math m)
{
math temp;
temp.number= number * number;
return number;
}
CS201 Solved Subjective by Muhammad Ishfaq Page No.3
Answer: The errors are in the arguments of the member operation function and also in
the body of operator member function. Correct function should be
math *operator(math *m);
math *operator (math *m)
{
math temp;
temp = m;
temp.number= number * number;
return temp.number;
}
Question ( Marks: 10 )
Write a program which consists of two classes, Date and Person.
Date class should contain three data members day, month, year and setter and getter
function for these data members. Date class should also contain showdate() member
function to display date.
Person class should contain three data members Name, Address, and Bday, where
Name and Address are char pointer while Bday(Date of birth) is of type Date, Person
class should further contain two member functions Display() and setdate().
In main program Create an object of Class person and call the member functions with it.
Answer:
#include <stdio.h>
#include <iostream>
#include <cstring>
using namespace std;
class Date
{
public:
int day;
int month;
int year;
public:
Date()
{
day=0;
month=0;
year=0;
}
void setDay(int);
void setMonth (int);
void setYear(int);
int getDay();
int getMonth();
int getYear();
void showDate();
};
CS201 Solved Subjective by Muhammad Ishfaq Page No.4
void Date: :setDay(int d)
{
if{d<1 | | d>31)More CS201 files
- CS201 Handouts by MS Rehman S26.pdf (PDF · Handout)
- CS201 Handouts by MS.pdf (PDF · Handout)
- CS201 Handouts.pdf (PDF · Handout)
- CS201 Handwritten Short Notes (VUAnswer.com) Handwritten-1.p (PDF · Handout)
- CS201 Handwritten Short Notes (VUAnswer.com) Handwritten.pdf (PDF · Handout)
- CS201 Handwritten Short Notes (VUAnswer.com) Handwritten.pdf (PDF · Handout)
- CS201 Handwritten Short Notes (vusolutionpoint.com).pdf (PDF · Handout)
- CS201 Highlight Handout by VUAnswer.com.pdf (PDF · Handout)