IDNLearn.com: Your one-stop destination for reliable answers to diverse questions. Our Q&A platform offers detailed and trustworthy answers to ensure you have the information you need.
(10 POINTS) in C ++ Define the missing function. licenseNum is created as: (100000 * customID) + licenseYear, where customID is a function parameter.
Sample output with inputs 2014 777:
Dog license: 77702014
#include
using namespace std;
class DogLicense {
public:
void SetYear(int yearRegistered);
void CreateLicenseNum(int customID);
int GetLicenseNum() const;
private:
int licenseYear;
int licenseNum;
};
void DogLicense::SetYear(int yearRegistered) {
licenseYear = yearRegistered;
}
// FIXME: Write CreateLicenseNum()
/* Your solution goes here */
int DogLicense::GetLicenseNum() const {
return licenseNum;
}
int main() {
DogLicense dog1;
int userYear;
int userId;
cin >> userYear;
cin >> userId;
dog1.SetYear(userYear);
dog1.CreateLicenseNum(userId);
cout << "Dog license: " << dog1.GetLicenseNum() << endl;
return 0;
}
Sagot :
Thank you for using this platform to share and learn. Keep asking and answering. We appreciate every contribution you make. IDNLearn.com has the solutions to your questions. Thanks for stopping by, and see you next time for more reliable information.