Question: C++ programming Please follow the provided template,thanks template Part 1 - Conversion Constructors Write Conversion Constructors for both QueryResponse and ServiceResponse in Response.cpp . Verify

C++ programming

Please follow the provided template,thanks

C++ programming Please follow the provided template,thanks template Part 1 - Conversion

template

Constructors Write Conversion Constructors for both QueryResponse and ServiceResponse in Response.cpp .Verify the following things in main class - 1. Create an objectof QueryResponse and use the conversion constructor to create an object ServiceResponse

Part 1 - Conversion Constructors Write Conversion Constructors for both QueryResponse and ServiceResponse in Response.cpp . Verify the following things in main class - 1. Create an object of QueryResponse and use the conversion constructor to create an object ServiceResponse from it. 2. Create an object of ServiceResponse and use the conversion constructor to create an object QueryResponse from it. Part 2 - Conversion Operators We can also use Conversion Operators instead of Conversion Constructors to achieve the same goal. Write Conversion Operators for both QueryResponse and ServiceResponse in Response.cpp . Verify the following things in main class - 1. Create an object of QueryResponse and use the conversion operator to create an object ServiceResponse from it. 2. Create an object of ServiceResponse and use the conversion operator to create an object QueryResponse from it. Part 3 - Friend Functions and Classes In order to get the ResponsePrinter class working, ResponsePrinter needs access to the private method getResponse of both QueryResponse & ServiceResponse classes. 1. Make ResponsePrinter a friend of QueryResponse to get the printQueryResponse method working. 2. Use the concept of Friend Function to get the printserviceResponse working. 3. Verify that you are able to print both in your main class. int main(int argc, const char *argv[]) { // Part: 1 QueryResponse queryResponse (5); ServiceResponse serviceResponse (9); QueryResponse convertedQueryResponse; ServiceResponse convertedServiceResponse; // Add Your Code here std::cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To complete this exercise youll need to implement conversion constructors conversion operators and friendship between classes Lets go through it stepb... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!