Private-public-protected access modifiers


Q1. Write down a program where numbers are stored in an array in a program. Construct two files even and odd by using command line argument, where odd file stores all the odd numbers in the array and even file stores all even numbers in array.

Q2. Define the term String Class. Overload == operator to compare two strings.

Q3. What does polymorphism signify in C++ language? How is polymorphism accomplished at:

a) Runtime and
b) Compile time?

Describe with the help of illustrations.

Q4. What do you mean by virtual base class? When do we make the class virtual?

Q5. What do you mean by friend class and friend functions? Why are they employed?

Q6. Write down a program to overload operator ‘<=’, to compare the length of the two strings.

Q7. Distinguish between the private, public and protected access modifiers. As well describe their meaning if a derived class inherits from a base class by using public, protected and private keywords. Give illustrations.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Private-public-protected access modifiers
Reference No:- TGS010823

Expected delivery within 24 Hours