CLICK HERE FOR VARIOUS NEW JOBS 
CLICK HERE FOR VARIOUS EDUCATIONAL NEWS 
CLICK HERE FOR NEW SCHOLARSHIPS 
CLICK HERE FOR ADMISSION NOTICES 
Click And Follow On Google+ To Get Updates
Please Wait 10 Seconds... OR You CanSkip

ADMISSION NOTICES
Scholarships

Scholarship-300x291

BUDGET 2014-15
budget_2014-2015
New Date Sheets
VU SOLVED ASSIGNMENTS
Recent Posts

Posts Tagged ‘Spring 2012’

VU CS304 – Object Oriented Programming FinalTerm solved unsolved past papers spring 2012

VU CS304 – Object Oriented Programming FinalTerm Solved Unsolved Past Papers Spring 2012

CS304 Current solved paper spring 2012

question # 1

A programmer implements virtual functions by the use of virtual keyword, like:

virtual void display(){
……………..
}
but how the virtual functions are implemented by compiler?

=========================================
Question # 2
Consider the following complex class,
class Complex{
private:
double real, img;
public:
……..
};
we want to overload subtraction(-) operator for our complex class such that
we can subtract any double value from our complex class object using any one
of the statements given below,
Complex c1;
complex c2 = 1.546-c1;
complex c3 = c1-2.456;
you have to give the c++ code of overloaded subtraction (-) operator to
perform thesekind of operations.

=============================
Question # 3
What are Iterators? explain input iterator and output iterator.

Ans:iterators are internal data member of container. That can traverse

a container without exposing its internal representation. Iterators are for
containers exactly like pointers are for ordinary data structures.

Input Iterators:

Using input iterators we can read an element, and we can only move in forward

direction one element at a time, these can be used in implementing those
algorithms that can be solved in one pass e.g moving container once in single
direction from start to end like find algorithm.

Output Iterators :

Using output iterators we can read an element, and we can only move in forward

direction one element at a time, these can be used in implementing those
algorithms that can be solved in one pass e.g moving container once in single
direction from start to end like find algorithm .

Question # 4
Consider the code below,
1. Template<typename T> class Test {
2. T value;
3. public:
4. Test( T val) : value(val) {}
5 Test (Const Test<T>& C): value (c.value) {}
6. }:
7. int main() {
8. Test<int> t1(0), t2(0);
9. Test<float> t3 =t1;
10. system(“pause”);
11. Return 0;
12. }

Given line number having any error/errors in this code ecplain the reason fro
error/s and give corrected code as well

Next quesiton

What ll be output after excuting following line of code, ( suppose there is no
error and code will be executed correctely, justify your answer as well,
class student{
static int noOf students;
int rollNo;
public:
student::Student(){
noOfStudents++;
}
Student::~Student(){
NoOfStudents–;
}
static int getTotalStudent(){
return noOfStudents;
}
};
int Student::noOfStudents=0;
int main(){
Student obj1, obj2;
{
student obj3;
}
cout<<student::getTotalstudent();
}

Next question,

Write c++ code that uses try catch block in member initialization list of any
class.
Ans:
Student::Student (String aName)
try : name(aName) {

}
catch(…) {
}

next question
Give the difference between virtual inheritance and multiple inheritance.
Ans:

Multiple Inheritance is bassically a process , The process when a child can be derived from
more than one parent class. And If more than one base class have a function with same
signature then the child will have two copies of that function; Calling such function will
result in ambiguity.
Example of multiple inheritance:
Suppose we have a changeGearmethod in Vehicle class that is applicable to bothwater and
land vehicle, we also have Float and Move methods in water and land vehicles respectively
then our amphibious vehicle will have all these methods,

While in In virtual inheritance there is exactly one copy of the anonymous base class object

Example of virtual inheritance:
class Vehicle{
protected:
int weight;
};
class LandVehicle :
public virtual Vehicle{
};
class WaterVehicle :
public virtual Vehicle{
};
Example
class AmphibiousVehicle:
public LandVehicle,
public WaterVehicle{
public:
AmphibiousVehicle(){
weight = 10;
}

};

=====================================
next question
Differentiate between specialization and sub-typing by giving most important
reson/s
Ans:

Specialization means that derived class is behaviorally incompatible with
the base class Behaviorally incompatibility means that base class can’t always
be replaced by the derived class Derived class has some different of restricted
characteristics than of base class.
Example: Suppose we want to add one more class of Adult for some special
requirement like for ID card generation such that it is a person but its age is greater than
18 and having all other behavior of that of person class.in this case the best solution is
that we derive adult class from person class and restrict age in that class.

Sub-typing means that derived class is behaviorally compatible with the
base class Derived class has all the characteristics of base class plus some extra
characteristics Behaviorally compatible means that base class can be replaced by the
derived class.
Example:
Student has two extra attributes program and studyYear Similarly it has extended
behaviour by adding study and takeExam.

==============================
next question explain the statment below

vector<int>ivec(4.3);

Ans:
in this case Vector instance will store our data .integers 4.3

next question
give at least one advantage and on disadvantage of templates.
Advantage:

can drastically reduce development time using templates in combination with STL. On a more
fundamental level, templates allow you to write a single algorithm and use it across different data
types.

Disadvantage: templates can’t be linked and distributed as a library. They must be compiled at

compile time, and, therefore, all implementations of a template algorithm must be included in the
header files in their entirety.

next qustion

what do you know about function templates? describe in berefly.

Ans:
We can use Function Templates where we want to write general
function like
printArray. It can be parameterized to operation different types of
data types.

Declaration:
template< class T >
void funName( T x );

Example:
template< typename T>
void printArray( T*array, int size )
{
for ( int i = 0; i < size; i++ )
cout << array[ i ] << “, ”; // here data type of array is T
}

next question

find out adn correct the syntax error(s) in the given code snippet?
template<classname T>
class Template_class{
private:
T data;
//…
Public:
///…
Void input ();
};
Template<class T>
void Template_class::input(){
cin>>data;

}void main()
{
Template_class<int>obj;
obj.input();
}

VU CS304 – Object Oriented Programming FinalTerm Solved Unsolved Past Papers Spring 2012

VU cs302 – Digital Logic Design FinalTerm solved unsolved past papers Spring 2012

VU Cs302 – Digital Logic Design FinalTerm Solved Unsolved Past Papers Spring 2012

Today’s paper cs302 – Digital Logic Design

BC100202129 – Umair Mehmood

Total Questions: 52

 

Total Marks: 80

Questions & Marks Division:-

40 MCQs*1 Mark, 4*2 Marks, 4*3 Marks, 4*5 Marks.

 

Question 41:- Explain state assignment process. (2)

 

Question 42:- How many bytes will be in 16K × 8 memory? (2)

 

Question 43:- Explain erase operation in context of FLASH Memory. (2)

 

Question 44:- Which of the following is DIGITAL & which is ANALOG? (2)

a)     Pressure in a bike’s tire

b)    Temperature

c)     Speed of a car

d)    Number of students in a class

 

Question 45:- Define “excitation inputs”. (3)

 

Question 46:- Explain rotate Right Operation of shift register with the help of diagram. (3)

 

Question 47:- Divide the following binary number “1101” by the binary number “101”. Write all the steps. (3)

 

 

Question 48:- What are the three operations of FLASH MEMORY? (3)

 

Question 49:- Convert the following caveman number system into decimal number system. (5)

i)                   Ω↑∑

ii)                 ↑∆∆∑

 

Question 50:- Differentiate between “MEMORY CPACITY” & “MEMORY DENSITY”. (5)

 

Question 51:- Draw next-state table of an UP-Counter with help of J-K flip-flop. (5)

 

Question 52:- Explain FLASH Analogue-to-Digital converter. (5)

 

 

 

VU Cs302 – Digital Logic Design FinalTerm Solved Unsolved Past Papers Spring 2012

ALL NEW RESULTS
Educational News

Updated Educational News

Categories
POSTS BY DATE
December 2016
M T W T F S S
« Sep    
 1234
567891011
12131415161718
19202122232425
262728293031