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
Yanka [14]
4 years ago
15

Design a class named Car that has the following fields:

Computers and Technology
1 answer:
snow_tiger [21]4 years ago
4 0

Answer:

// The class car is defined

public  class Car {

  // instance variable yearModel

  private int yearModel;

  // instance variable make

  private String make;

  // instance variable speed

  private int speed;

 

  // empty constructor

  // with instances inside it

  // the instances are from the question

  public Car(){

      yearModel = 2000;

      make = "Nissan";

      speed = 4;

  }  

  // overloaded constructor

  // constructor defined with three arguments

  public Car(int yearModel, String make, int speed) {

      // the arguments are assigned to the object's variable

      this.yearModel = yearModel;

      this.make = make;

      this.speed =speed;

  }

  // setter(mutator) method

  public void setYearModel(int yearModel){

      this.yearModel = yearModel;

  }

  // setter(mutator) method

  public void setMake(String make){

      this.make = make;

  }

  // setter(mutator) method

  public void setSpeed(int speed){

      this.speed = speed;

  }

  // getter(accessor) method

  public int getYearModel(){

      return yearModel;

   }

  // getter(accessor) method

  public String getMake(){

      return make;

   }

  // getter(accessor) method

  public int getSpeed(){

      return speed;

   }  

  // toString is override to display the car object properties

  public String toString(){

      return "Car's year model: " + getYearModel() + ", make: " + getMake() + ", speed: " + getSpeed();

  }

}

Explanation:

The code is well commented.

You might be interested in
What automatically created subdomain holds all the SRV records for Microsoft-hosted services, such as the global catalog, LDAP,
nevsk [136]

Answer:

The correct answer to the following question will be "_msdcs".

Explanation:

Msdcs directory known as Microsoft Domain Controller Catalog requires SRV documents that are used to identify domain controller for certain operations.

  • It automatically generated subdomain keeps all Microsoft-hosted resources SRV data, so it's the correct answer.
  • It includes common SRV documents, documents of LDAP, documents of Kpass, CNAME, etc.
7 0
4 years ago
Which of the following best describes how computing devices represent information ​
olganol [36]

Answer:

A system is which a computer is used to turn data into information best describes a computer-based information system.

A text code is a system that uses binary numbers (1s and 0s) to represent characters understood by humans (letters and numerals). y An early text codesystem, called EBCDIC, uses eight-bit codes, but is used primarily in older mainframe systems.

Data processing is simply the conversion of raw data to meaningful information through a process. ... Similar to a production process, it follows a cycle where inputs (raw data) are fed to a process (computer systems, software, etc.) to produce output (information and insights).

The central processing unit consists of electronic circuits that interpret and execute program instructions, as well as communicate with the input, output, and storage devices. It is the central processing unit that actually transforms data into information. Data is the raw material to be processed by a computer.

Explanation:

5 0
3 years ago
Columns are labeled with letters and Rows are labeled with numbers.
n200080 [17]
The answer is A.True
3 0
3 years ago
Does anyone know how I can fix this? It keeps saying that it’s an illegal start of an expression and that it is missing an ; at
tangare [24]

Answer:

Use stackoverflow it's a website for proggramers

7 0
3 years ago
You are going to do a bubble sort on the following list. What are the missing members of the list? Select 3 options.
Nadya [2.5K]
The bubble sort makes multiple passes through a list. It compares adjacent items and exchanges those that are out of order. Each pass through the list places the next largest value in its proper place. In essence, each item “bubbles” up to the location where it belongs.
4 0
3 years ago
Read 2 more answers
Other questions:
  • . Electricians will sometimes call ______ "disconnects" or a "disconnecting means."
    12·1 answer
  • When encountering another vessel in darkness or reduced visibility, what do visible red and green lights indicate
    9·1 answer
  • What is plagiarism?<br> EXPLAIN IT
    15·2 answers
  • Which of the following extends a network over a large geographic area by connecting local area networks together?
    14·2 answers
  • Technician A says that using 100% coolant is better for freeze protection in an engine than a mixture with water. Technician B s
    13·1 answer
  • What does a codec do? Choose all that apply.
    5·2 answers
  • All the read/write heads a hard disk are controlled by a(n) ____ which moves the read/write heads across the disk surfaces in un
    13·1 answer
  • Computers are able to think like human beings true or false?
    10·1 answer
  • What combination of keys will autofill highlighted cells to the right?
    10·1 answer
  • A penetration tester is experimenting with Network Mapper (Nmap) on a test network as a privileged user. The tester would like t
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!