Question
Add a constructor initializer list to the default Applicant constructor to initialize shortName with Unfilled, experience with -999, and partTime with 'X'. Ex: If the
Add a constructor initializer list to the default Applicant constructor to initialize shortName with "Unfilled", experience with -999, and partTime with 'X'.
Ex: If the input is Ari 8 Y, then the output is:
Applicant: Unfilled, Experience: -999, Part Time: X Applicant: Ari, Experience: 8, Part Time: Y
#include
class Applicant { public: Applicant(); void SetInformation(string newShortName, int newExperience, char newPartTime); void Print() const; private: string shortName; int experience; char partTime; };
Applicant::Applicant() /* Your code goes here */ { }
void Applicant::SetInformation(string newShortName, int newExperience, char newPartTime) { shortName = newShortName; experience = newExperience; partTime = newPartTime; }
void Applicant::Print() const { cout << "Applicant: " << shortName << ", Experience: " << experience << ", Part Time: " << partTime << endl; }
int main() { string newShortName; int newExperience; char newPartTime; Applicant myApplicant; myApplicant.Print(); cin >> newShortName; cin >> newExperience; cin >> newPartTime; myApplicant.SetInformation(newShortName, newExperience, newPartTime); myApplicant.Print(); return 0; }
In C++ Please!
Step 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