Professional Documents
Culture Documents
CS 214 - IV Semester - B.tech (CS-IT) - 2022 - Second Periodical Test
CS 214 - IV Semester - B.tech (CS-IT) - 2022 - Second Periodical Test
Note: Students are required to attempt Three questions. Question No. 1 is compulsory.
Q1. Create a class Staff having fields such as Staff Id, Name, Department, Designation,
salary. Write a menu driven program for:
Q.2 How many arguments are required in the definition of an overloaded binary
operator? Write a program to perform multiplication using an integer and object. Use
member function. [3]
OR
Q3. Can we overload the insertion (<<) and extraction (>>) operator? If yes then explain
how with the help of suitable example. Also explain the need of overloading these two
operators. [3]
Q4. What is copy constructor? If the compiler creates a copy constructor by default then
what is the need of making it explicitly? Justify you answer with example. [3]
OR
Q5. (a)Write a program in C++ to add and multiply two complex numbers using friend
function.
(b) What is string class in C++? Write a C++ program to accept the string from the user
and print the string in reverse order. In order to solve this problem use at() function.
[1.5+1.5]