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
julsineya [31]
3 years ago
12

"Write a class named Car that has the following data attributes:" _ _year_model (for the car’s year model) _ _make (for the make

of the car) _ _speed (for the car’s current speed)
Computers and Technology
1 answer:
UkoKoshka [18]3 years ago
6 0

Answer:

public class Car {

   private String __year_model;

   private String __make;

   private int __speed;

   //Creating the constructor

   public Car(String __year_model, String __make, int __speed) {

       this.__year_model = __year_model;

       this.__make = __make;

       this.__speed = __speed;

   }

   //Creatining the set and get methods

   public String get__year_model() {

       return __year_model;

   }

   public void set__year_model(String __year_model) {

       this.__year_model = __year_model;

   }

   public String get__make() {

       return __make;

   }

   public void set__make(String __make) {

       this.__make = __make;

   }

   public int get__speed() {

       return __speed;

   }

   public void set__speed(int __speed) {

       this.__speed = __speed;

   }

}

Explanation:

As stated in the question, The class Car is created using Java programming language with the three attributes year_model, make and speed.

Constructors as well as set and get methods were also created for each of the fields.

You might be interested in
I just downloaded an update for my laptop. Now, it doesn't give me a notification when the battery is low, and it just shuts off
givi [52]
Have you tried resetting it on your own first ? Although, it could just be a bug from this update (being something you can't solve until the next one) But you can try resetting it, or going to settings and clicking on battey, maybe the update turned that off ? Sometimes they do that, too! I hope all is well. ((:
7 0
3 years ago
Imagine the world in 2030 and write a letter to your future self. Be sure to mention things that you think your future self woul
Nuetrik [128]
I’m making this easy & basic so if you need to use it, feel free!



Dear Future me, It feels a little strange to be writing a letter to my future self, but it’s also rather exciting! At present I am very interested in sports and am sure this is a hobby that has proved beneficial because I can hit a home run.
So tell me have things changed a lot? Do we still have a lot of restaurants? Has Artificial Intelligence proved to be taking over the world? You must be so used to social distancing while we struggle to figure out a cure.

Is our pet fish doing well or have you replaced it with robot? Ha! Ha! It’s so much easier, right?! How is your preparation for the new job? Must be really nice to be an adult! Have you changed our hair? Maybe our style? Am sure things have turned out well for you in 2030. Great talking to you! Stay safe.It’s been nice writing to you Hope this letter brings back old memories…

Sincerely, past you.
7 0
3 years ago
6. By default,how the table headings are placed. (2 Points)
Dmitrij [34]
They are all bold and what ever else
6 0
3 years ago
Assume you have written a method with the header num mymethod(string name, string code). the method's type is
azamat
I need answer choices
5 0
4 years ago
What is the output for the following code?<br><br> print (5*4+5)
Damm [24]

Answer:

It will just print 5*4+5 .

But you still need to add " ".

8 0
3 years ago
Other questions:
  • PC’s &amp; More has shifted to sales and service of laptops and PCs, where it has the potential to triple the number of its cust
    14·1 answer
  • Which one of the following oscilloscope controls is used to move the trace up and down the screen vertically
    14·1 answer
  • Which event occurs when the user clicks on an html element?
    9·1 answer
  • I need help, please and thank you.
    7·2 answers
  • Spreadsheet software can be used to do all the following except _____.
    5·2 answers
  • Pat practices on the keyboard to improve his typing speed. When he typed the sentence It was a rainy day, he missed typing the l
    6·1 answer
  • Question #2
    15·2 answers
  • What is the difference between second generation and third generation​
    15·1 answer
  • Describe the difference between information poor and information rich society?​
    9·1 answer
  • The agency that started ARPANET was looking for
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!