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]
3 years ago
15

Design a class named Car that has the following fields:

Computers and Technology
1 answer:
snow_tiger [21]3 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
Basic python coding, What is the output of this program? Assume the user enters 2, 5, and 10.
r-ruslan [8.4K]

Answer:

17.0

Explanation:

after first loop numA = 0.0 + 2 = 2.0

after second loop numA = 2.0 + 5 = 7.0

after third loop numA = 7 + 10 = 17.0

8 0
3 years ago
((11111111-1011100) X (10100 / 10))- ( 110010000+ 1110011)
dsp73

Answer:

10089891099

Explanation:

?

3 0
2 years ago
How do I add my bestie on brainy? /??!!! ​
ziro4ka [17]

Answer:

You have to remember their name on here

Explanation:

If u dont you cant talk to them again

3 0
2 years ago
Sometimes data you export from Access needs to be formatted as a text file instead of an Excel file.
g100num [7]

Answer:

b. False

Explanation:

Microsoft access is a database management application that can store data that can be queried from every other microsoft applications like Word, Access, Onenote etc. its attachments can be converted to best best suit the application or client that needs the file or data.

Accesss database sheets are very to Excel worksheets or books. Tabular data, Graphs and most (if not all) data format can be linked, imported or queried between Access and Excel application. Formatting files (example csv files) to text are not necessary or encouraged when exporting files.

8 0
3 years ago
1. Jaina is a big fan of a popular comic book series, and is so inspired that she decides to write her own story. She starts her
dolphi86 [110]

Answer:

copyright infringement

Explanation:

4 0
3 years ago
Other questions:
  • The vast amount of data collected from Internet searches, social media posts, customer transactions, military
    8·1 answer
  • A slow response when opening applications or browsing the Internet, applications that do not work properly, an operating system
    5·2 answers
  • Dotted Decimal Notation was created to______________. Group of answer choices provide an alternative to IP addressing express ea
    12·1 answer
  • This exercise shows why each pivot (in eli1nination by pivoting) must be in a different row. (a) In Example 7, make the third pi
    15·1 answer
  • Why do chloroplasts appear only in plant cells and lysosomes appear only in animal cells?
    13·1 answer
  • Project 15A - Math Application
    10·1 answer
  • What type of platform is SAP?
    9·1 answer
  • Why should information technology NOT be taught in school?​
    14·1 answer
  • What would a world where we have 2^128 (340 undecillion) Internet connected devices look like? How could that much Internet usag
    7·1 answer
  • 1. Keisha is in her first semester of college and is taking 10 credit hours: ACA 122, CIS 110, PSY 150, and developmental math.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!