Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 using namespace std;

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

305 mg of C6H12O6 in 55.2 mL of solution whats the molarity

Answered: 1 week ago