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
Scorpion4ik [409]
4 years ago
13

Write the code that creates a public class named Vehicle that has one private data member. The private data member is an integer

variable named modelYear. Create two constructors: Code a constructor that has no parameters and initializes the modelYear variable to 2018. Code a constructor that has one parameter and uses that parameter value to update the modelYear variable.
Computers and Technology
1 answer:
maxonik [38]4 years ago
3 0

Answer:

Following are the program in java

public class Vehicle // class vehicle of type public

{

private int modelYear;

Vehicle() //  no parameters

{

modelYear=2018;

}

vehicle(int t)  // update the value of modelYear

{

modelYear=t;

}

public static void main(String args[]) // main function

{

vehicle ob=new vehicle();// creating instance

vehicle ob1=new vehicle(45);

}

}

Explanation:

Here we create a private data member i.e modelYear of integer type .

We create default constructor and initializes modelYear variable  with 2018.

we create a parametrized constructor  which update the value of modelYear variable.

From the main function we call both the constructors.

You might be interested in
Which type of input peripheral is most prevalent in a Point of Sale system?A. External USB storage.
Darina [25.2K]

Answer:

B. Card reader.

Explanation:

Peripheral devices are generally auxiliary devices such as mouse, keyboard, card reader, pen drives, microphones, graphics cards, etc. that are connected with the computer are work in some way with it. In Point of sale (POS) devices card reader are used to read debit or credit cards.

4 0
3 years ago
Read 2 more answers
Which material, distributed to audience members, contains additional information about topics covered in the presentation?
Vladimir79 [104]
Outlines because you would not want the audience to know what exactly is on the slides, but just an outline to give them an idea of what is to come.
8 0
3 years ago
Read 2 more answers
A certain audio compact disc (cd) contains 783.216 megabytes of digital information. each byte consists of exactly 8 bits. when
kakasveta [241]
You are not putting the question but I can guess that it asking for the CD duration. To answer this question, you need to convert the CD capacity unit(783.216 megabyte) into megabits which were used for the cd read rate (1.4 megabits/s). The calculation would be:

CD duration: CD capacity / rate= 783.216 megabytes *(8 megabits/megabyte) / (1.4 megabits /s)= 4475.52 second or 74.6 minutes
3 0
4 years ago
What makes up data encryption standard ?
galben [10]

Answer:

Data Encryption Standard Use Cases. The DES was a data security standard used to encrypt and decrypt non-classified computer data generated by the United States government and any commercial organization. The Data Encryption Standard (DES) is a symmetric-key block cipher published by the National Institute of Standards and Technology (NIST). ... Note that both the right section and the key are 48-bits in length. Also note that the round key is used only in this operation. The DES is a product block cipher in which 16 iterations, or rounds, of substitution and transposition (permutation) process are cascaded.

Explanation:

If this helps can i have brainliest

8 0
3 years ago
Localize the software problem and describe it<br>​
sweet [91]

Answer:

Do you have any idea how to get the best and most importantly I

5 0
3 years ago
Other questions:
  • In what year did commercial use of the Internet become available? 1991 1996 1999 2001
    9·1 answer
  • HELP PLEASE ASAP!!! Does anyone know how to fix a broken iPhone which when I connect it to the charger it comes up with the Appl
    5·1 answer
  • Study the sentence below
    13·2 answers
  • In which of the following situations is it probably better to use a fixed-size array over another more flexible option, like Arr
    6·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    11·1 answer
  • Describe how a black and white image could be represented in binary
    11·2 answers
  • WILL GIVE BRAINLIEST!!! PLEASE HELP!!!
    5·1 answer
  • PLEASE HELP ME WITH MY UNIT TEST!!!!!!!!!!!!!! I'M STRUGGLING AND I AM ESPECIALLY STUCK ON THIS ONE!!!!!!!!!!!!!!!!!!!!!! FOR BR
    7·1 answer
  • HELP URGENT
    5·1 answer
  • HC - AL-Career Preparedness
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!