CS201 Solved SUBJECTIVE Final Term By JUNAID.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
PDF
Type
Final-Term
Coverage
Final-Term Exam Scope (Lectures 23 to 45)
Tags
SUBJECTIVE, SOLVED, 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

  1. Object-Oriented Paradigms: Classes & Data Abstraction — Lectures 23 to 29 (Pages 281 to 360). 16% Final-Term Marks (Core OO Concepts)
  2. Inheritance Hierarchies & Dynamic Polymorphism — Lectures 30 to 36 (Pages 361 to 435). 20% Final-Term Marks (Virtual Functions & V-Tables)
  3. Templates, Standard Library & Persistent File I/O — Lectures 37 to 41 (Pages 436 to 510). 14% Final-Term Marks (Generic Code & Streams)
  4. 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 Solved SUBJECTIVE Final Term By JUNAID.pdf for free?

You can preview and download "CS201 Solved SUBJECTIVE Final Term By JUNAID.pdf" (CS201 PDF, ~320 pages) directly from the MIHORA VU Study Library (https://study.mihora.tech/doc/cs201-solved-subjective-final-term-by-junaid-pdf-3) 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-Intruduction to Programming
Solved SUBJECTIVE for Final terms papers
  Solved by JUNAID MALIK and Team

AL-JUNAID INTITUE GROUP
1. How can we overcome the issue of dangling reference in a program?
   Ans:
   We can avoid the dangling pointer errors by initialize pointer to NULL, after
   de-allocating memory, so that pointer will be no longer dangling. Assigning
   NULL value means pointer is not pointing to any memory location.
   Pointers
   The Pointer in C is a variable that stores address of another variable. A
   pointer can also be used to refer to another pointer function.

2. // what will be output of the program below?
   Ans:

#include <iostream>

using namespace std;

int main ()

{

    int i =2;

    int j =3;

    int k=2*++i*j++;

    cout<<k;

}

AL-JUNAID INTITUE GROUP

3. What is overloading declaration for a stream extraction (>>) for an
   integer.
   Ans:
    C++ is able to input and output the built-in data types using the stream
    extraction operator >> and the stream insertion operator <<. The stream
    insertion and stream extraction operators also can be overloaded to perform
    input and output for user-defined types like an object.

4. Suppose an object of class A is declared as data member of class B.
   Ans:
     The constructer of which class will be called first?
     The distracter of which class will be declared first?
     A
     B
5. //identify and correct error(s) in given code.
    while (c<=5);
     {
           sum + =c;
           c ++;
    }
    Ans:

AL-JUNAID INTITUE GROUP
   Logical error

6. Identify each of the following as system software and application
   software.
   Ans:
    LINUX, DISK CLEANUP, WORD PROCESSOR, WINDOWS, STUDENT
    INFORMATION

   System software: - Linux, Disk cleanup, windows.
   Application software: - Word Processor, Student information

7. //what will be the output of the following code snippet?
   Ans:
    {
    int x=10;
    int &y=x;
    y+=5;
    cout<<x;

8. Write a function named sum which accepts an integer in the function use
   a static variable to add the passed to it as arguments with each function
   call in the end, display the sum of values passed as arguments?
   Ans:
    #include <iostream>
    using namespace std;
    int main(){

AL-JUNAID INTITUE GROUP
      //Declaring two integer variables
      int num1, num2;
      /* cout displays the string provided in the
       * double quotes as it is on the screen
       */
      cout<<"Enter first integer number: ";
      /* cin is used to capture the user input
       * and assign it to the variable.
       */
      cin>>num1;

      cout<<"Enter second integer number: ";
      cin>>num2;
      cout<<"Sum of entered numbers is: "<<(num1+num2);
      return 0;
   }
9. Define static variable also explain life time of static variable?
   Ans:
   Static variables refer to maintaining the state of a variable. It exists and
   exists even when we lose function. It is created and initialized only once
   during the life cycle of the program, so it will only be destroyed or deleted
   from memory once during the life cycle of the program.

10.What do you know about run time error?
   Ans:
   Runtime errors occur when the program is running and trying to do
   something that violates the rules.
   Example: accessing variables, properties, methods, objects, etc.

11.What is limitation of the friendship between classes?
   Ans:
   The friendship relationship between classes is a one-way relationship, that is,
   if one class declares friends to another class, then the other class is a friend of
   the first class, but if it is a friend of another class, it is not the first class.

AL-JUNAID INTITUE GROUP
12.Write a program with defines a template function name Add() which
   adds two variable and then returns the sum . Define two variables of
   type int main function and then Add() function on these variables .
    Program output should look like this:
    Ans:
    #include <iostream>
    using namespace std;

   int main()
    {
    int x;
    int y;
    int sum;
    cout<<"Enter the value of x = ";
    cin>>x;
    cout<<"Enter the Value of y = ";
    cin>>y;
    sum=x+y;
    cout<<"sum of two Number = "<<sum;
    }

13.program output should look like this Enter two integer values to be
   added
   Ans:
    Enter First value:
    12
    Enter Second value:
    25
    Addition of two variable of different data type
    Sum =37
    SOLUTION:
    #include <iostream>
    using namespace std;

   int main()

AL-JUNAID INTITUE GROUP
    {
    int x;
    int y;
    int sum;
    cout<<"Enter the value of x = ";
    cin>>x;
    cout<<"Enter the Value of y = ";
    cin>>y;
    sum=x+y;
    cout<<"sum of two Number = "<<sum;
    }
14.Construct a logical expression to represent each following condition:
   Ans:
      a) Score is greater than or equal to 80 butt less than 90;
      b) Answer is either N or n;
      c) Nis even butt not 8;
      d) Number is a multiple of both 4 and 6

      class Outer{

        int i = 60;

        class Inner{

            void display(){

                System.out.println(i);

            }

        }

        public static void main(String args[]){

            Inner o = new Inner();

            o.display();

AL-JUNAID INTITUE GROUP
          }

      }

15.In a C++ program how would you identify whether a declared variable is
   a “reference variable ” or an “address variable”?
   Ans:
   A reference variable's address cannot be changed once set, but when I run the
   command, how is my reference's value changed, but the address is the same?
   And since the address is the same as, shouldn't the value of ref still be 3, or
   maybe shouldn't a's value change into 5, because how can one address have
   two values
16.What will be the value of the given expression after evaluation if x=3 and
   y=2?
   Ans:
   (++X*++y)-2
   We can rewrite the given expression as follows –

   x = x – (x++ - ++y)

   Let us break down the expression and compute the results for better
   understanding

   x++ - ++y

   =3–8

   = -5

More CS201 files

All CS201 files · Midterm Prep 2026 · MCQs Bank