Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In the FishermanLicense class, declare the following public member functions: SetYear() that takes one integer parameter SetNum() that takes one integer parameter SetId() that takes

In the FishermanLicense class, declare the following public member functions:

SetYear() that takes one integer parameter

SetNum() that takes one integer parameter

SetId() that takes one integer parameter

and the following private data members:

integer year

integer number

integer id

Ex: If the input is 1998 37 772, then the output is:

License year: 1998 License number: 37 License id: 772

#include using namespace std;

class FishermanLicense { public: int GetYear() const; int GetNum() const; int GetId() const; /* Member function declarations go here */ private: /* Data members go here */ };

void FishermanLicense::SetYear(int customYear) { year = customYear; }

void FishermanLicense::SetNum(int customNum) { number = customNum; }

void FishermanLicense::SetId(int customId) { id = customId; }

int FishermanLicense::GetYear() const { return year; }

int FishermanLicense::GetNum() const { return number; }

int FishermanLicense::GetId() const { return id; }

int main() { FishermanLicense fisherman1; int inputYear; int inputNum; int inputId;

cin >> inputYear; cin >> inputNum; cin >> inputId;

fisherman1.SetYear(inputYear); fisherman1.SetNum(inputNum); fisherman1.SetId(inputId); cout << "License year: " << fisherman1.GetYear() << endl; cout << "License number: " << fisherman1.GetNum() << endl; cout << "License id: " << fisherman1.GetId() << endl;

return 0; }

c++ asap and please plase make it correct

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_2

Step: 3

blur-text-image_3

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

Transactions On Large Scale Data And Knowledge Centered Systems Xxviii Special Issue On Database And Expert Systems Applications Lncs 9940

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Qimin Chen

1st Edition

3662534541, 978-3662534540

More Books

Students also viewed these Databases questions