Exam question on C++ program to read, add and display complex data

Unsure of how to answer a programming-related query in a previous year's exam paper of Bengaluru University? Let our software programming experts assist you in solving the exam question.

Following is the question asked in the Bengaluru University B.E. (E&E)- III semester question paper for January 2018 examination. This question is asked for 12 marks and hence requires some explanation along with the program code. Please let me know the solution.

Q) Write a C++ program to define a class complex with real and imaginary as data members and get_data(), add(), and display_data() as member functions to read, add and display complex object.