cs304_mid_term_2_www.vu786.com.pdf
Verified academic study resource for CS302 (Digital Logic Design) under the Computer Science at Virtual University of Pakistan. This PDF document (Midterm Solved Past Paper & Revision File) covers Mid-Term Exam Scope (Lectures 1 to 22) spanning approximately 240 pages across 4 curriculum modules, and is indexed for student examination review with instant in-browser preview and 100% free direct download.
- Course
- CS302 – Digital Logic Design
- Faculty
- Computer Science
- Format
- Type
- Study Resource
- Coverage
- Mid-Term Exam Scope (Lectures 1 to 22)
Focus on core definitions and repeated MCQs from Lectures 1–22. Remember that scoring in the First Half builds your safety buffer toward the mandatory 20% Two-Half passing rule in CS302.
What this file covers — CS302 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)
Frequently asked questions
Where can I download cs304_mid_term_2_www.vu786.com.pdf for free?
You can preview and download "cs304_mid_term_2_www.vu786.com.pdf" (CS302 PDF, ~240 pages) directly from the MIHORA VU Study Library (https://study.mihora.tech/doc/cs304-mid-term-2-www-vu786-com-pdf) with 100% free high-speed downloads and zero registration requirements.
What syllabus chapters and lectures are covered in this CS302 file?
This document covers Mid-Term Exam Scope (Lectures 1 to 22) across 4 distinct lecture units (Lectures 1 to 6, Lectures 7 to 12, Lectures 13 to 18, Lectures 19 to 22), featuring comprehensive definitions, solved objective questions, and examiner marking rubrics.
What is the passing criteria for CS302 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 CS302 solved past papers and handouts verified for 2026 exams?
Yes. All CS302 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
Cs304
Question No: 1 ( Marks: 2 ) - Please choose one
Which of the statements is true about destructor?
► Destructors are used to initialize data members
m
► Destructors return types are always void
► Destructors are called in reverse order of constructor called in a class hierarchy
co
► Destructors are used to display the data members of their respective class
Question No: 2 ( Marks: 2 ) - Please choose one
6.
Identify the type of variable that is part of a class, yet is not part of an object of that class.
► instance 78
► static
► global
vu
► local
Question No: 3 ( Marks: 2 ) - Please choose one
Which of the following operators can not be overloaded?
w.
► ++
ww
► new
► sizeof
►=
Question No: 4 ( Marks: 2 ) - Please choose one
Target function for a call is selected at compile time in case of
► Static binding
m
► Polymorphism
► Encapsulation
co
► Dynamic binding
Question No: 5 ( Marks: 2 ) - Please choose one
6.
Suppose it is required to implement a single functionality with different data type, which of the
following techniques should be used
► Inheritance
78
► Friend function
► Templates
vu
► Encapsulation
Question No: 6 ( Marks: 5 )
w.
Identify and correct the error(s) in the given code segment.
template< typename T >
class Parent {
// …
};
ww
template< >
class Child< int > : public Parent {
// …
};
int main() {
Parent< char > obj;
Child< int > obj2;
return 0;
}
Question No: 7 ( Marks: 10 )
Given are two classes A and B. class B is inherited from class A. Write a code snippet(for main
function) that polymorphically call the method of class B. Also what changes do you suggest in the
m
given code segment that are required to call the class B method polymorphically.
class A
{
co
public:
void method() { cout<<"A's method \n"; }
};
class B : public A
6.
{
public:
void method() { cout<<"B's method\n"; }78
};
Question No: 8 ( Marks: 10 )
Implement the given class hierarchy where there exist a relation ship of inheritance between
Employee and Contract (for contract employee). The Display() function of Contract should
vu
display the data that includes ; Name, Num_hours, Per_hour_sal, Salary
Monthly salary of contract employee is calculated as
Salary = Per_hour_sal*Num_hours
w.
ww
m
co
6.
Question No: 9 ( Marks: 15 )
A Real world Problem:
78
This is a business rule of a bank that the Balance of customer must always be Positive,
Further that it is also a business rule that a customer can not withdraw amount greater than his/her
current balance.
vu
Question statement
You are required to write a C++ program to solve this real world problem, using Exception
Handling.
Your program should consist of a class Customer and 4 instance variables. Cust_name,
w.
Cust_AC_No, Cust_balance, Amount_withdraw.
Cust_name : Customer Name
Cust_AC_No : Customer Account Number
Cust_balance : Customer Balance
Amount_withdraw : Amount that is to be withdraw
ww
The class should further consists of getter and setter function for each instance variable.
The setter function of Cust_balance consists of a try and a catch block, if the user enters the
balance less than zero (means negative, which is not possible) then this function should throw an
exception, and its corresponding catch block should handle this exception by providing another
opportunity to the user to enter the balance again.
Similarly the setter of Amount_withdraw variable should also have a try and a catch blocks. If the
user enters the withdraw amount greater than the current balance then this function should throw
an exception, and its corresponding catch block should handle this exception.
In main function just declare an object of Customer class and call all its setter and getter functions.
m
co
6.
78
vu
w.
ww
More CS302 files
- CS-302 Digital Logic Design.pdf (PDF · Study Resource)
- CS302 - 1.pdf (PDF · Study Resource)
- CS302 - 2.pdf (PDF · Study Resource)
- CS302 - 3.pdf (PDF · Study Resource)
- CS302 - 4.pdf (PDF · Study Resource)
- CS302 - Lab Manual - Week No (1 - 3).pdf (PDF · Study Resource)
- CS302 - Lab Manual - Week No (1 - 3).pdf (PDF · Study Resource)
- CS302 - Lab Manual - Week No (1 - 3).pdf (PDF · Study Resource)