loading...

CS201 VU Final Paper 23 February 2013

Total Questions: 52

Total Marks: 80

Total MCQs: 40 (Each of 1 Mark)
Total Short Questions: 4 (Each of 2 Mark)
Total Short Questions: 4 (Each of 3 Mark)
Total Long Questions: 4 (Each of 5 Mark)
Q.make a program using getline function
Q.make a program using template function select two floating point number and add them with add() function.(5)
Q.make a program take salary and pay tax of 5% if salary is less than 10,000 and pay 7% if the salary is greater than 10,000 using switch function.
Q.what are the function of new and delete ?
Q.what are the stream insertion overloaded operators?

Q Write a program which open a file name “this.txt” and then using write() function, writes the string “Introduction to Programming” at the end of the file.
Q What will be the output of the program:
Int x=10;
Int&y=x;
Y+=5;
Coutx;
Q A two dimensional array has 3 rows and 4 columns. Write down the syntax to initialize first element of all three rows of two dimensional array with value 2.
Q How can we initialize an object which is created as constant data member in another class?
Q An array delare int day[]={1,2,3,4,5,6,7}
How many elements have?
If the declaration ofarray is changed to int days[7]={1,2,3,4,5,6,7}
How many elements have?

Another Paper:



Today Final Term Paper Fall 2012
On 21 Feb 2013

Total Questions: 52

Total Marks: 80

Total MCQs: 40 (Each of 1 Mark)
Total Short Questions: 4 (Each of 2 Mark)
Total Short Questions: 4 (Each of 3 Mark)
Total Long Questions: 4 (Each of 5 Mark)

CS201

Q1: (Marks 5) Write a program that defines a Template function named Add () which adds two numbers returns Sum. Define two variables of int type in the main and then call Add () function on that.
Output should be like this:

Adding numbers (don’t remember here what was written)
Enter first number:
12
Enter second number:
25
Sum=37

Q2: (Marks 5) Find the error in the program and then remove this. (Don’t remember the coding)

Q3: (Marks 5) Given the class Data

main()
{
class Date
{
private:
int day, month, year;
public:
day=01;
month=10;
year=2010
}
……………..Dont remember the lines
……………..
……………..

}

Use the dynamically allocation (don’t remember what)
In the last also free memory allocation.

Q4: (Marks 3) Why goto is not recommended to use in programmes?
Q5: (Marks 2) Write two types of data conversions used for used defined data types.
Q6: (Marks 2) Write the following using logical operators:
1. number is both multiple of 4 and 6
2. number is even but not 8
3. answer is either N or n
4. don’t remember this

Q7: (Marks 3) Write the output of the following if “int 5” is passed to the variable:
Template <class T);
T reciprocal (T x);
{
return (1/x);
}
(it was like something. Don’t remember exactly)

Q8: (Marks 3): How can we determine that dynamically memory allocation has been set successfully or not is C++ using the new operator?

 

DOWNLOAD SOLUTION HERE
loading...