156k views
2 votes
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

User Vu Le Anh
by
7.9k points

2 Answers

4 votes

Answer: C++

void DogLicense:: CreateLicenseNum(int customID) {

licenseNum = (100000* customID) + licenseYear;

return;

}

User Mikeon
by
8.4k points
3 votes

Answer:

Written in Python:

def licenseNum(licenseYear, customID):

output = 100000 * customID + licenseYear

print("Dog license: "+str(output))

Step-by-step explanation:

This line defines the function with parameters licenseYear and customID

def licenseNum(licenseYear, customID):

This calculates the output as stated in the question

output = 100000 * customID + licenseYear

This displays the output

print("Dog license: "+str(output))

To call the function, make use of: licenseNum(2014, 777)

Where 2014 and 777 can be replaced with other digits as required

User BernhardWebstudio
by
8.2k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.