vu cs304 Mid Term Subjective Solved Past Paper No.1

vu cs304 Object Oriented Programming Solved Past Papers

Solved Past Papers

This subjective solved past paper is related to book/course code vu cs304 Object Oriented Programming which belongs to vu organization. We have 3 past papers available related to the book/course Object Oriented Programming. This past paper has a total of 10 subjective questions belongs to topic Mid Term to get prepared. NVAEducation wants its users to help them learn in an easy way. For that purpose, you are free to get prepared for exams by learning subjective questions online on NVAEducatio.

NVAEducation also facilitates users to download these solved past papers with an affordable prices. However, users are not enforced to pay for money, rather they can use credits to buy such stuff on NVAEducation. Users can earn credits for doing some little tasks and then you will be able to use that credits to buy solved past papers on NVAEducation.

Question 1: Find out error in the code given below:
if ( num % 2 = 0 )
cout << "The number is even" << endl;
Answer:
if ( num % 2 = 0 ) There should be extra "e;="e; sign following is right statement is "e;if ( num % 2 == 0 )"e;
Question 2: Give the general syntax of class template.
Answer:
Syntax of class template:
template <class T>
class class-name()
{
definition of class
};
Page No.29
Question 3: How a program can use a function?
Answer:
The calling program just needs to write the function name and provide its arguments (without data types). It is important to note that while calling a function, we don't write the return value data type or the data types of arguments.
Question 4: How can we initialize data members of contained object at construction time?
Answer:
Initializer list is used to initialize the contained objects at the construction time.
Question 5: How is the following cout statement interpreted by compiler?
cout << a << b << c ;
Answer:
It will give a compiler error because a,b,c are not declared.
Question 6: How learning to design programs is like learning to play soccer?
Answer:
"Learning to design programs is like learning to play soccer. A player must learn to trap a ball, to dribble with a ball, to pass, and to shoot a ball. Once the player knows those basic skills, the next goals are to learn to play a position, to play certain strategies, to choose among feasible strategies, and, on occasion, to create variations of a strategy because none fits. " (page 6)
Question 7: How learning to design programs is like play soccer?
Answer:

Learning to design programs is like learning to play soccer. A player must learn to trap a ball, to dribble with a ball, to pass, and to shoot a ball. Once the player knows those basic skills, the next goals are to learn to play a position, to play certain strategies, to choose among feasible strategies, and, on occasion, to create variations of a strategy because none fits.

Question 9: Briefly explain CMPS.
Answer:
CMPS subtracts the source location DS:SI from the destination location ES:DI. Source and Destination are unaffected. SI and DI are updated accordingly. CMPS compares two blocks of memory for equality or inequality of the block. It subtracts byte by byte or word by word. If used with a REPE or a REPNE prefix is repeats as long as the blocks are same or as long as they are different. For example it can be used for find a substring. A substring is a string that is contained in another string. For example "has" is contained in "Mary has a little lamp." Using CMPS we can do the operation of a complex loop in a single instruction. Only the REPE and REPNE prefixes are meaningful with this instruction

Solved Past Papers of cs304 Object Oriented Programming

Other cs related subjective solved past papers

Other categories of vu Solved Past Papers

Other organizations

Theme Customizer

Gaussian Texture



Gradient Background