Assignment 1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Heaven’s Light is Our Guide

Rajshahi University of Engineering & Technology


Department of Computer Science & Engineering

CSE 1203 (Object Oriented Programming)


Assignment 1 (Marks 20)

1. What is operator overloading? How can you overload these operators


described in following scenario? Let, A is a class.

A a,b,c; //three objects of class A been declared

i) cin>>a>>b;
ii) c = a + b;
iii) cout<<c;
iv) c = a – b;
2. “C++ uses the only compiler whereas, in Java, compiler and interpreter both
are used” – is this statement correct? Explain your answer briefly.
3. Discuss the base class access control mechanism.
4. What is polymorphism? How can we achieve polymorphism in C++?
Discuss different types of polymorphism with example.
5. Design a class named "Student" which have the following properties:
a. Name
b. Roll
c. CGPA
Now, declare an array of student so that information of 60 students can be
stored. Then, take input for every student and sort the array with respect to
Name.
6. What are the differences between pointer and reference? (Give example)
7. What is ambiguity in function overloading? Can we achieve overloading
without declaring multiple functions?
8. What is virtual inheritance? Explain with example.
9. "Static data member needs to be defined outside class but static function
members don’t need to be defined outside of class" - do you agree with the
statement? Write explanation to defend your answer.
10. Write a program that prints the following loop i) using for loop ii) using
while loop in C++ and JAVA.
1
23
456
7 8 9 10

You might also like