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
xxMikexx [17]
4 years ago
14

Define the missing method. licenseNum is created as: (100000 * customID) + licenseYear. Sample output: Dog license: 77702014

Computers and Technology
1 answer:
trapecia [35]4 years ago
4 0

Answer:

This is the missing method createLicenseNum()      

  public void createLicenseNum(int customID){

// the function createLicenseNum() with int type parameter customID

       licenseNum = (100000 * customID) + licenseYear;    }  

//the formula for creating license number

Explanation:

The whole program is given below:

public class DogLicense {

   private int licenseYear;

   private int licenseNum;

   public void setYear(int yearRegistered) {

       licenseYear = yearRegistered;

       return;    }

   public void createLicenseNum(int customID){

       licenseNum = (100000 * customID) + licenseYear;   }

   public int getLicenseNum() {

       return licenseNum;    } }

public class CallDogLicense  {

   public static void main (String [] args) {

       DogLicense dog1 = new DogLicense();

       dog1.setYear(2014);

       dog1.createLicenseNum(777);

       System.out.println("Dog license: " + dog1.getLicenseNum());

       return;    } }

The class DogLicense has two private int type variables licenseYear and licenseNum. It has three methods, setYear() which sets the licenseYear to yearRegistered, createLicenseNum() which is used to create a license number according to the given formula and has a parameter customID, getLicenseNum() which returns the license number which is created in the createLicenseNum().

The class CallDogLicense has a main function and an instance dog1 of class DogLicense. The object calls setYear() function to set the value of licenseYear as 2014 and calls createLicenseNum and passes value of customID as 777.

Finally getLicenseNum() function is called which returns the LicenseNum value and the output is Dog license: 77702014

The program output is attached as a screenshot.

You might be interested in
Which goal of design theory can be described as the proper distribution
muminat
The answer is balance
7 0
3 years ago
NEED HELP NOW 12 POINTS!!!!!!
vlada-n [284]
The first one seems the most relivant
4 0
3 years ago
Read 2 more answers
Choose the response that best completes the following statement.
slava [35]

Answer:

consider the outcome

Explanation:

7 0
3 years ago
3 features of digital computer​
jolli1 [7]

Answer:

A typical digital computer system has four basic functional elements: (1) input-output equipment, (2) main memory, (3) control unit, and (4) arithmetic-logic unit. Any of a number of devices is used to enter data and program instructions into a computer and to gain access to the results of the processing operation.

Explanation:

6 0
3 years ago
Describe the seven layers of the OSI Reference Model.
kvv77 [185]

Answer:

i hope this helps you

Explanation:

6 0
3 years ago
Other questions:
  • Write down the complete procedure for creating ExcelSheet.
    8·1 answer
  • what is the opportunity cost of buying a $.75 soda everyday at school for 3 years instead of drinking water ? assume you are in
    10·2 answers
  • 6. Write a program that can multiply an n x m matrix and m x n matrix together: The input specifications are these: Read n and m
    11·1 answer
  • What is an electronic path over which data can travel.
    7·1 answer
  • Convert 15 from decimal to binary. Show your work.
    14·1 answer
  • It's usually easier to change the design of a photo album slide show A.after you've created the presentation. B.before you've cr
    15·1 answer
  • Why Prithvi Narayan Shah are appointed the person favoured by the people at Kazi
    8·1 answer
  • After reviewing device security you learn that a malicious user in an airport
    14·1 answer
  • Which of these countries has very strict cultural
    8·2 answers
  • If consumers start to believe they need a product, what is likely to happen
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!