Answer:
#include <iostream>
using namespace std;
int main() {
cout<<"My name is Rajat Sharma"<<endl<<"My address is Flat no=23 GH=5 Paschim Vihar New Delhi 110087 India"<<endl;
return 0;
}
Explanation:
The program is written in C++ language.In the program I have used cout to print my name and the address.First the name will be printed then the address in the new line endl is used for new line.To print any sentence just put them in double quotes.The same sentence in the program will be printed on the screen.
Answer:
Hi!
The correct answer is one data field and two links fields.
Explanation:
The node of a doubly-linked list contains one data field, and two links fields that references to the next node on the list and another one link field that references to the previous node in the sequence of nodes).
Answer:
First one is INHERITANCE. Second one is AGGREGATION.
Answer:
Person p1, p2, p3;
int m1, m2, m3;
p1 = new Person();
// assignment 1
m1 = p1.getMoney();
p2 = new Student();
// assignment 2
m2 = p2.getMoney();
p3 = new Employee();
// assignment 3
m3 = p3.getMoney();
//////////////////////////////////////////////////////////////////////////////////////////////
The reference to getMoney in assignment 3 is to the <em>Person</em> class.
Explanation:
Since Employee class didn't override Person class's getMoney() method, calling p3 with getMoney() will call Base class's (Person) getMoney() method.