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
Network in which every computer is capable of playing the role of the client, server or both at the same time is called *
zheka24 [161]

Answer:

peer to peer

Explanation:

Here, we want to select which of the options best answer the question.

The answer is peer to peer

The peer to peer network configuration is a type in which each computer can work as a client, a server or both

Thus , in a peer to peer network configuration, we can have the computer systems on this network having the possibility of working as either the client, the server or both of them simultaneously

6 0
3 years ago
When you try to move the desktop icon using the click and drag method and it doesn't move, what is the reason?​
Romashka-Z-Leto [24]
You aren’t clicking hard enough. Go to settings and push help
6 0
1 year ago
Convert the binary (base-2) number 1001 to decimal (base-10).
Serga [27]

Answer:

Binary 1001 is decimal 9.

Explanation:

For this problem, we simply need to understand that a binary number can be converted to a decimal number with multiplication of the "on bits".  Let's begin.

First, note that in binary, as digits grow to the right, they are being multiplied by 2.  In decimal, as digits grow to the right, they are being multiplied by 10.

For example

0001 in binary is equivalent to 2^0 since a 1 is in the first position.

1 in decimal is equivalent to 10^0 since it is in the first position.

Taking this concept a bit further consider:

101 in binary is equivalent to 2^2 + 2^0 since a 1 is in the third position and a 1 is in the first position.

101 in decimal is equivalent to 10^2 + 10^0 since a value is in the third position and a value is also in the first position.

With this in mind, let's convert the binary 1001 to decimal.

1001

= 1 * 2^3 + 0 * 2^2 + 0 * 2^1 + 1 * 2^0

= 2^3 + 2^0

= 8 + 1

= 9

Hence, binary 1001 is decimal 9.

Cheers.

8 0
3 years ago
Write the pseudocode for a program that will process attendance records of CA students. The students attend college five days a
Alenkasestr [34]

Using the knowledge of pseudocodes it will be possible to write a code that calculates the amount of hours worked and giving warnings about it.

<h3>Writing a pseudocode we have that:</h3>

<em>while </em>

<em>if number == 0</em>

<em>break</em>

<em>hours =0 </em>

<em>for i =1 to 5 </em>

<em>hours = hours + time_out[ i ] - time_in[ i ]</em>

<em> If hours >36 : </em>

<em>print ( "Name is " ,name)</em>

<em>print( "No of hours are ",hours)</em>

<em>print("Congratulaion! Your working hours are more than 36")</em>

<em>If hours <30 : #</em>

<em>print ( "Name is " ,name)</em>

<em>print( "No of hours are ",hours)</em>

<em>print("Warning !!!")</em>

<em>End loop</em>

See more about pseudocode at brainly.com/question/13208346

#SPJ1

3 0
2 years ago
Select the correct word to complete the sentence.
Mariana [72]

Answer:

NSFNET

Explanation:

6 0
2 years ago
Other questions:
  • Technological progress has reduced the cost of manufacturing mp3 players. what happens if demand is unchanged?
    9·1 answer
  • It is safe to stand on the top step of a ladder provided it is braced property
    10·1 answer
  • A thesaurus can be used to look up a (n) or word similar in meaning to a given word
    15·1 answer
  • If the user loads this graphic in a text only browser how will the browser describe it?
    11·2 answers
  • The objective of this task is to use Scapy to estimate the distance, in terms of number of routers, between your VM and a select
    10·1 answer
  • I have no idea what I’m doing and this is due in 45 minutes
    7·1 answer
  • Which of these examples demonstrate portfolio income?
    13·2 answers
  • Which of the following statements about content-based filtering is TRUE?
    9·1 answer
  • A person who breaks into a computer, network, or online site is called
    14·2 answers
  • What is analog computer? where is it used​
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!