Question
I have serval problems on Utilities module. Please advise how to solve it. Thank you. Utilities module This module should contain a single function that
I have serval problems on Utilities module. Please advise how to solve it. Thank you.
Utilities module
This module should contain a single function that creates instances on the Person hierarchy:
Person* buildInstance(std::istream& in);
This function should extract data from the parameter; if the first non-blank character is eor E, then this function should dynamically create instance of type Employee passing the stream to the constructor, and return it to the client.
This function also builds an instance of type Student if the first non-blank character extracted from the stream is s or S, and to build an instance of type Professor if the first non-blank character extracted from the stream is p or P.
If there is no more information to be extracted from the stream, this function should return nullptr.
Because the input file contains two types of delimiters (" " for records, and "," for the fields in a record), you can use the class std::stringstream (utilization of this class is not mandatory, the extraction can be achieved without using it).
When implementing the buildInstance function, consider the following STL class:
- std::stringstream
Problem A: How to return to the client?
Problem B:
C+ Utilities.cpp part 2 x object of abstract class type "sdds::Student" is not allowed: C/C++(322) [Ln 109, Col 25] Utilities.cpp[Ln 109, Col 25]: pure virtual function "sdds::Person::age" has no overrider Utilities.cpp[Ln 109, Col 25]: pure virtual function "sdds::Person::id" has no overriderStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started