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 ‘VU CS201-’

VU CS201 – Introduction to Programming (Session – 1 ) FinalTerm solved unsolved past Papers SPRING 2006

VU CS201 – Introduction To Programming (Session – 1 ) FinalTerm Solved Unsolved Past Papers SPRING 2006

FINALTERM EXAMINATION

Marks: 50

SPRING 2006

CS201 – INTRODUCTION TO PROGRAMMING

Time: 120min

(Session – 1 )

StudentID/LoginID:

______________________________

Student Name:

______________________________

Center Name/Code:  ______________________________
Exam Date:

Wednesday, August 23, 2006

 

 

 

Please read the following instructions carefully before attempting any of the questions:

 

1. Attempt all questions. Marks are written adjacent to each question.

 

2. Do not ask any questions about the contents of this examination from anyone.

 

a. If you think that there is something wrong with any of the questions, attempt it to the best of your understanding.

 

b. If you believe that some essential piece of information is missing, make an appropriate assumption and use it to solve the problem.

 

c. Write all steps, missing steps may lead to deduction of marks.

 

d. All coding questions should be answered using the C ++ syntax.

 

You are allowed to use the Dev-C++ compiler to write and test your code. If you do so please remember to copy and paste your code into the examination solution area. (Do NOT share your code; your colleague could get higher marks than you!!)

 

**WARNING: Please note that Virtual University takes serious note of

 

unfair means. Anyone found involved in cheating will get an `F` grade in this course.

 

 

For Teacher’s use only

 

Question

1

2

3

4

5

6

7

8

9

Total

 

www.vupages.com

 

ConnectingVUStudents

 

Marks

 

 

 

Question No: 1 ( Marks: 2 ) – Please choose one A for loop usually consist of __________ expressions.

 

►  1

 

 

►  3

 

►  2

 

►  4

 

Question No: 2  ( Marks: 2 )   – Please choose one

 

A preprocessor directive is identified by _________ symbol

 

►  #

 

►  {

 

►  (

 

►  ~

 

Question No: 3 ( Marks: 2 ) – Please choose one Which of the following operators can not be overloaded?

 

►  new

 

►  delete

 

►  +=

 

►  sizeof

 

Question No: 4  ( Marks: 2 )   – Please choose one

 

www.vupages.com

 

ConnectingVUStudents

 

Analyze the following code class myclass

 

{

 

private: float x,y;

public:

 

void myclass(float a, float b)

{

x=a;

y=b;

 

}

void diplay()

{

 

cout<<endl<<x<<endl<<y;

}

};

 

What is wrong with the above code?

 

 

►  The member functions should be private

 

►  constructor must not have a return type

 

►  The constructor should have no body

 

►  There is no error in the given code

 

Question No: 5  ( Marks: 6 )

 

Analyze the following code and list all the errors and line numbers in the given code. int i=2;

 

for(i<=100;i++)

{

if(i%2==0)

{

cout<<i;

 

cout<<” is even /n’;

}

}

 

 

Question No: 6  ( Marks: 7 )

 

Declare a class student having the following data members and member functions in the

 

www.vupages.com

 

ConnectingVUStudents

 

class.

 

stdno(integer)

 

stdname(character array of size 20) phone(long integer)

 

getdata() function that will read data into members data. Display() function that will display the data on the screen.

 

Question No: 7  ( Marks: 6 )

 

a. Write the statement that will create an array of 10 objects of the class student and place the base address of the array in a pointer ptr of the class student given in Question No. 6.

 

b. Write the code of the parameterized constructor for the class student given in

Question No. 6.

 

 

Question No: 8  ( Marks: 15 )

 

Write a program that will create a class distance. The class distance consist of two data members feet and inches, both of types float. The class distance consist of two member functions, getdata() and show(). The function getdata() is used to read data from the user through keyboard into feet and inches. The show() function is used to display the values of feet and inches on the screen.

 

The program will create two objects dest1 and dest2 of the class distance. The program will read data into dest1 and dest2 using getdata(). The program will create another object dest3 of the class distance by overloading the minus “-“operator trough expression dest3=dest1-dest2. The program will then display dist3 on the screen using show() function. The program also takes care of the fact that distance can not be negative. If dest2 is larger then dest1 then dest3 should not be created and program should display the message “Distance can not be negative”.

 

 

 

Question No: 9  ( Marks: 8 )

 

What are the benefits of the templates?

 

VU CS201 – Introduction To Programming (Session – 1 ) FinalTerm Solved Unsolved Past Papers SPRING 2006

VU CS201 – Introduction to Programming FinalTerm solved unsolved past Papers 2005

VU CS201 – Introduction To Programming FinalTerm Solved Unsolved Past Papers 2005

CS201 Introduction to Programming

 

Final Term Examination – February 2005

Time Allowed: 150 Minutes

 

Please read the following instructions carefully before attempting any of the Questions:

 

1. Attempt all questions. Marks are written adjacent to each question. 2. Do not ask any questions about the contents of this examination from anyone.

a. If you think that there is something wrong with any of the questions, attempt it to the best of your understanding.

 

b. If you believe that some essential piece of information is missing, make an appropriate assumption and use it to solve the problem. c. Write all steps, missing steps may lead to deduction of marks.

d. All coding questions should be answered using the C ++ syntax.

 

You are allowed to use the Dev-C++ compiler to write and test your code. If you do so please remember to copy and paste your code into the examination solution area.

(Do NOT share your code; your colleague could get higher marks than you!!)

 

**WARNING: Please note that Virtual University takes serious note of unfair means. Anyone found involved in cheating will get an `F` grade in this course.

 

 

Total Marks: 100                                                                                                  Total

 

Questions: 13

 

Question No. 1                                                                                                             Marks : 2

 

A function declaration has the same relationship to a function definition that

 

1      a class definition has to an object definition

 

2      an object declaration has to an object

3      a variable has to a variable declaration

4      a variable declaration has to the variable itself

5      they have no relationship

 

 

Question No. 2                                                                                                                                     Marks : 12

 

 

 

Write a function to overload subtraction operator for Class Order, which you created in previous question. The class has following attributes/ data members

 

i)  OrderID

ii)  Items

iii)  PricesOfItems

 

Write the main () to call the – operator and print the result also. This operator should subtract the items of one object from the other.

 

 

Question No. 3                                                                                                             Marks : 4

 

What is the difference between an array and a structure?

 

 

Question No. 4                                                                                                             Marks : 2

 

When we write a class template the first line must be:

 

1      template < class class_type>

 

2      template < class data_type>

3      template < class T >, Here T can be replaced with any name but it is preferable.

4      class class-name()

5      class template<class_name>

 

 

Question No. 5                                                                                                             Marks : 2

 

A friend function of a class has access

 

1      To all data member and functions of the class

 

2      Only to other friend functions of the class

3      Only to private data of the class

4      Only to public data of the class

5      To private data declared in main()

 

 

Question No. 6                                                                                                             Marks : 5

 

Briefly describe the role of each of the following within a class:

 

  1. Instance variables

 

  1. Instance methods
  2. Constructors

 

 

Question No. 7                                                                                                             Marks : 20

 

Create a class named Order. This class has the following attributes/ data members

 

i)  OrderID

ii)  Items

iii)  PricesOfItems

 

a) Create the object of this class using parameterized constructor in order to initialize OrderID and Items data members. Default values of both the data members must be equal to 1.

b)  Write the following member functions of this class;

i)      OrderBill ( ), this function will calculate the invoice of an order and display the result. The formula to calculate the invoice is

invoice=SumPrices();

 

ii)     SumPrices( ), this function will sum the prices of the items entered by the user from

 

keyboard in PricesOfItems array and returns the result.

 

c) Write the setter functions for OrderID, Items, and PricesOfItems. And getter functions for OrderID and Items.

 

Also write the main () to create the object of class Order.

 

 

 

Question No. 8                                                                                                             Marks : 2

 

The new operator

 

1      is used to declare objects or variables

 

2      can not create and initialize an object

3      names an object or variable

4      returns an address to an object or variable

5      can allocate an appropriate amount of memory for an object or variable

 

 

Question No. 9                                                                                                             Marks : 15

 

Write a program that inputs one string of max length of 10. If the string is identical to “Virtual”, output the message “Correct Password”; otherwise, output the first four characters in the message and the length of the message.

 

 

Question No. 10                                                                                                           Marks : 2

 

If we open a file stream myfile for reading, what will give us the current position of the file pointer?

 

1      tellg()

 

2      tellp()

3      seekg()

4      seekp()

5      fstream.h

 

 

Question No. 11                                                                                                           Marks : 2

 

There is a class Student, Which one of the following is a valid destructor for this class.

 

1    Student();

 

2      Student(int);

 

3      ~ Student();

4      int~ Student();

5      ~ Student(int);

 

 

Question No. 12                                                                                                           Marks : 5

 

What is a friend function? Explain with example?

 

 

Question No. 13                                                                                                           Marks : 6

 

Write code that will declare, initialize, and fill in an array of objects of type int. After your code executes, the array should look as follows.

 

0    2          4          6          8          10         12        14         16         18

 

VU CS201 – Introduction To Programming FinalTerm Solved Unsolved Past Papers 2005

VU CS201 – Introduction to Programmming FinalTerm solved unsolved past papers Spring 2010

VU CS201 – Introduction To Programmming FinalTerm Solved Unsolved Past Papers Spring 2010

FINALTERM  EXAMINATION

Spring 2010

CS201- Introduction to Programming

Ref No: xxxxxxx

Time: 90 min

Marks: 58

Student Info
Student ID: bcxxxxxxxxx
Center: OPKST
Exam Date: 09-08-2001

 

 

For Teacher’s Use Only

Q No.

1

2

3

4

5

6

7

8

Total

Marks

      

      

      

      

      

      

      

      

      

Q No.

9

10

11

12

13

14

15

16

 

Marks

      

      

      

      

      

      

      

      

      

Q No.

17

18

19

20

21

22

23

24

 

Marks

      

      

      

      

      

      

      

      

      

Q No.

25

26

27

28

29

30

31

32

 

Marks

      

      

      

      

      

      

      

      

      

Q No.

33

34

35

36

 

 

 

 

 

Marks

      

      

      

      

      

      

      

      

      

 

 

 

 

 

Question No: 1      ( Marks: 1 ) – Please choose one

 

 

In if structure the block of statements is executed only,

 

       ► When the condition is false

 

       ► When it contain arithmetic operators

 

       ► When it contain logical operators

 

       ► When the condition is true

 

 

 

Question No: 2      ( Marks: 1 ) – Please choose one

 

 

Header file: fstream.h includes the definition of the stream classes __________.

 

 

       ► ifstream, fstream, cout

 

       ► ifstream, fstream, ofstream

 

       ► fstream, cin, cout

 

       ► None of the above

 

 

 

Question No: 3      ( Marks: 1 ) – Please choose one

 

 

To access the data members of structure _______ is used.

 

       ► dot operator (.)

 

 

       ► * operator

 

 

       ►  operator

 

 

       ► None of given.

 

 

 

 

 

Question No: 4      ( Marks: 1 ) – Please choose one

 

 

eof( ), bad( ), good( ), clear( ) all are manipulators.

 

       ► True

 

       ► False

 

 

 

Question No: 5      ( Marks: 1 ) – Please choose one

 

 

Which kind of functions can access private member variables of a class?

 

 

 

       ► Friend functions of the class

 

       ► Private member functions of the class

 

       ► Public member functions of the class

 

       ► Friend, private and public functions

 

 

 

 

Question No: 6      ( Marks: 1 ) – Please choose one

 

 

The return type of operator function must always be void.

 

 

       ► True

 

       ► False

 

 

 

Question No: 7      ( Marks: 1 ) – Please choose one

 

 

Friend function of a class is ______________ .

 

 

 

       ► Member function

 

 

       ► Non-member function

 

 

       ► Private function

 

 

       ► Public function

 

 

 

Question No: 8      ( Marks: 1 ) – Please choose one

 

 

Function implementation of friend function must be defined outside the class.

 

 

       ► True

 

       ► False

 

 

 

Question No: 9      ( Marks: 1 ) – Please choose one

 

 

The normal source of cin object is,

 

 

       ► File

 

 

       ► Disk

 

 

       ► Keyboard

 

 

       ► RAM

 

 

 

 

 

Question No: 10      ( Marks: 1 ) – Please choose one

 

 

Which of the following is correct way to initialize a variable x of int type with value 10?

 

 

       ► int x ; x = 10;

 

       ► int x = 10;

 

       ► int x, x = 10;

 

       ► x = 10;

 

 

 

Question No: 11      ( Marks: 1 ) – Please choose one

 

 

Consider the following code segment. What will be the output of the following program?

 

int func(int) ;

int num = 10 ;

 

int main(){

int num ;

num = 5 ;

cout << num ;

cout << func(num) ;

}

int func(int x){

return num ;

}

 

 

       ► 5, 5

 

 

       ► 10, 5

 

 

       ► 5, 10

 

 

       ► 10, 10

 

 

 

 

Question No: 12      ( Marks: 1 ) – Please choose one

 

 

With template function, the compiler automatically detects the passed data and generates a new copy of function using passed data.

 

 

       ► True

 

       ► False

 

 

 

Question No: 13      ( Marks: 1 ) – Please choose one

 

 

What will be the correct syntax to declare two-dimensional array of float data type?

 

 

       ► float arr{2}{2} ;

 

 

 

       ► float arr[2][2] ;

 

 

 

       ► float arr[2,2] ;

 

 

 

       ► float[2][2] arr ;

 

 

 

 

Question No: 14      ( Marks: 1 ) – Please choose one

 

 

The first parameter of operator function for << operator,

 

 

 

 

       ► Must be passed by value

 

       ► Must be passed by reference

 

       ► Can be passed by value or reference

 

       ► Must be object of class

 

 

 

Question No: 15      ( Marks: 1 ) – Please choose one

 

 

Heap is constantly changing in size.

 

       ► True

 

       ► False

 

 

 

Question No: 16      ( Marks: 1 ) – Please choose one

 

 

While calling function, the arguments are assigned to the parameters from _____________.

 

       ► left to right.

 

       ► right to left

 

       ► no specific order is followed

 

       ► none of the given options.

 

 

 

Question No: 17      ( Marks: 1 ) – Please choose one

 

 

Classes defined inside other classes are called ________ classes

 

       ► looped

 

       ► nested

 

       ► overloaded

 

       ► none of the given options.

 

 

 

Question No: 18      ( Marks: 1 ) – Please choose one

 

 

If we define an identifier with the statement #define PI 3.1415926 then during the execution of the program the value of PI __________.

 

 

 

       ► can not be replaced

 

 

       ► None of the given options

 

 

       ► Remain constant.

 

 

       ► can be changed by some operation

 

 

 

Question No: 19      ( Marks: 1 ) – Please choose one

 

 

Which value is returned by the destructor of a class?

 

 

       ► A pointer to the class.

 

       ► An object of the class.

 

 

       ► A status code determining whether the class was destructed correctly

 

 

       ► Destructors do not return a value.

 

 

 

 

Question No: 20      ( Marks: 1 ) – Please choose one

 

 

Every class contains _______________.

 

 

 

       ► Constructor

 

 

       ► Destructor

 

 

       ► Both a constructor and a destructor

 

 

       ► None of the given options

 

 

 

 

Question No: 21      ( Marks: 1 ) – Please choose one

 

 

A template function must have

 

 

       ► One or more than one arguments

 

 

       ► Only one argument

 

 

       ► Zero arguments

 

 

       ► None of the given options

 

 

 

Question No: 22      ( Marks: 1 ) – Please choose one

 

 

Structured Query Language is used for ______________

 

       ► Databases Management

 

       ► Networks

 

       ► Writing Operating System

 

       ► none of the given options

 

 

 

Question No: 23      ( Marks: 1 ) – Please choose one

 

 

When a call to a user-defined function finishes, the variable defined inside the function is still in existence.

 

 

       ► True

 

       ► False

 

 

 

Question No: 24      ( Marks: 1 ) – Please choose one

 

 

The precedence of an operator can be changed through operator overloading.

 

       ► True

 

       ► False

 

 

 

Question No: 25      ( Marks: 1 ) – Please choose one

 

 

A Matrix can be composed of ints, floats or doubles as their elements. Best way is to handle this , _______________

 

       ► Write a separate class to handle each

 

 

       ► Use templates

 

       ► Use strings to store all types

 

       ► None of the given options

 

 

 

Question No: 26      ( Marks: 1 ) – Please choose one

 

 

“delete” operator is used to return memory to free store, which is allocated by the “new” operator.

 

 

       ► True

 

       ► False

 

 

 

Question No: 27      ( Marks: 2 )

 

 

What is the difference between switch statement and if statement.

 

 

 

Question No: 28      ( Marks: 2 )

 

 

How can we initialize data members of contained object at construction time?

 

 

Question No: 29      ( Marks: 2 )

 

 

How the data members of a class are initialized with meaningful values?

 

 

 

Question No: 30      ( Marks: 2 )

 

 

Can we overload new and delete operators?

 

 

Question No: 31      ( Marks: 3 )

 

 

What will be the output of following functions if we call these functions three times?

 

1)

void func1(){

int x = 0;

x++;

cout << x << endl;

}

2)

void func2(){

static int x = 0 ;

x++;

cout << x << endl ;

}

 

Question No: 32      ( Marks: 3 )

 

 

What is the keyword ‘this’ and what are the uses of ‘this’ pointer?

 

 

Question No: 33      ( Marks: 3 )

 

 

Suppose an object of class A is declared as data member of class B.

 

(i) The constructor of which class will be called first?

 

(ii) The destructor of which class will be called first?

 

Question No: 34      ( Marks: 5 )

 

 

Write the general syntax of a class that has one function as a friend of a class along with definition of friend function.

 

Question No: 35      ( Marks: 5 )

 

Write down the disadvantages of the templates.

 

Question No: 36      ( Marks: 5 )

 

 

Write a program which defines five variables which store the salaries of five employees, using setw and setfill manipulators to display all these salaries in a column.

 

Note: Display all data with in a particular width and the empty space should be filled with character x

Output should be displayed as given below:

xxxxxx1000

xxxxxx1500

xxxxx20000

xxxxx30000

xxxxx60000

 

 

VU CS201 – Introduction To Programmming FinalTerm Solved Unsolved Past Papers Spring 2010

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