1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
tresset_1 [31]
4 years ago
10

Define the missing function. licenseNum is created as: (100000 * customID) + licenseYear. Sample output:

Computers and Technology
2 answers:
k0ka [10]4 years ago
8 0

#include <iostream>

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()

void DogLicense::CreateLicenseNum(int customID) {

   licenseNum = (100000 * customID) + licenseYear;

}

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;

}

Juliette [100K]4 years ago
6 0

Answer:

#include <iostream>

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;

}

void DogLicense::CreateLicenseNum(int customID) {

   licenseNum = (100000 * customID) + licenseYear;

}

int DogLicense::GetLicenseNum() const {

   return licenseNum;

}

int main() {

   DogLicense dog1;

   dog1.SetYear(2014);

   dog1.CreateLicenseNum(777);

   cout << "Dog license: " << dog1.GetLicenseNum() << endl;

return 0;

}

Explanation:

You can see the whole code above, but let me explain the fixed function.

void DogLicense::CreateLicenseNum(int customID) {

   licenseNum = (100000 * customID) + licenseYear;

}

The function header is already declared in the class. It takes <em>customID</em> as a parameter. To find out the <em>lisenseNum</em>, we need to apply the given formula <em><u>(100000 * customID) + licenseYear</u></em>.

You might be interested in
Which of these are the two main components of a CPU?
Mrrafil [7]

Answer:

Control unit and Arthemitic logic unit

plz mark me as brainlist

7 0
3 years ago
Read 2 more answers
Which osi model layer manages data encryption?
Hoochie [10]
The presentation Layer manages data encryption.
7 0
4 years ago
Hello hello . please help me​
adelina 88 [10]

Answer:

#include <iostream>  

using namespace std;  

int main()  {  

 int num, check=0;  

 for(int num = 1; num<=100;num++){

for(int i = 2; i <= num/2; i++)  {

     if(num % i == 0)   {  

         check=1;  

         break;         }     }  

 if (check==0)  {       cout <<num<<" ";     }

 check = 0;

 }

 return 0;  

}

Explanation:

This line declares num as integer which represents digits 1 to 100.

A check variable is declared as integer and initialized to 0

<em>  int num, m=0, check=0;   </em>

This for loop iterates from 1 to 100

 for(int num = 1; num<=100;num++){

This iterates from 2 to half of current digit

for(int i = 2; i <= num/2; i++)  {

This checks for possible divisors

     if(num % i == 0)   {  

If found, the check variable is updated to 1

         check=1;  

And the loop is terminated

         break;         }     }  

The following if statement prints the prime numbers

 if (check==0)  {       cout <<num<<" ";     }

 check = 0;

 }

5 0
3 years ago
Read 2 more answers
I need app ideas please help​
Artemon [7]

Answer:

I have a few ideas although most are simple and for nothing too useful

1. ghost simulator (you can like haunt people and mess with all their stuff and the more u f with them tge more points and the higher level u get you get more power and more ability to mess with things like eventually you'll be able to possess things and ig the goal wou.d be to either kill the person living in your house or scare them until they run away and there can be little side missions for like extra points and accessories n stuff)

2. my forest (you have workers that make money and the more money you get the more stuff u can buy for your forest and you can customize it and it's pretty much like a therapeutical thing where you can make a pretty forest w mystical creatures and stuff

3. egg (its literally just an egg on the screen that's it there is just an egg)

Explanation:

first things that came to mind I just like brainstorming at these kinda things lmk if u plan on using any aspect of my ideas I'd love to see your app

4 0
3 years ago
2 2.2.4 Quiz: Setting Up a Business Letter
AVprozaik [17]

Answer: It is made up of several records.

Explanation: I just got it right in Ape x

4 0
3 years ago
Other questions:
  • A computer professional who has access to sensitive information shares this information with a third party. Which professional c
    9·2 answers
  • Hich of the following usually indicates that there is no moreinput to be read by a program?
    14·1 answer
  • Which inserted element in an email message displays a graphic from a data source
    15·2 answers
  • Write a program that reads a series of strings andprints only those strings beginning with the letter "b."
    7·1 answer
  • Shawn works at the local electrical company in Nampa, ID, which provides electricity to the entire city of Boise. This area is p
    14·1 answer
  • Find the complete predicate in the sentence below.
    6·1 answer
  • Four categories of installer apps
    13·1 answer
  • Which kind of blocks is used to hold values​
    7·1 answer
  • Question 1 of 10 Chase lives in Oregon but works for a company that is located in Florida. What business trend is this an exampl
    11·2 answers
  • Questions: What memory modules are needed if the customer wants 3 GB of RAM? What capacities and how many modules of each capaci
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!