Get the most out of your questions with IDNLearn.com's extensive resources. Ask anything and receive immediate, well-informed answers from our dedicated community of experts.
(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 :
We appreciate your participation in this forum. Keep exploring, asking questions, and sharing your insights with the community. Together, we can find the best solutions. Thank you for visiting IDNLearn.com. We’re here to provide clear and concise answers, so visit us again soon.