subject

Write a class named car that has the following fields: yearmodel. the yearmodel field is an int that holds the car's year model make. the make field references a string object that holds the make of the car speed. the speed field is an int that holds the car's current speed in addition, the class should have the following constructor and other methods: constructor. the constructor should accept the car's year model and make as arguments. these values should be assigned to the object's yearmodel and make fields. the constructor should also assign 0 to the speed field. accessors. appropriate accessor methods should get the values stored in an object's yearmodel, make, and speed field. accelerate. the accelerate method should add 5 to the speed field each time it is called brake. the brake method should subtract 5 from the sped field each time it is called. demonstrate the class in a program that creates a car object, and then calls the accelerate method five times. after each call to the accelerate method, get the current speed of the car and display it. then call the brake method five times. after each call to the brake method, get the current speed of the car and display it.*/

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 12:30
What is the difference between the internet and the world wide web?
Answers: 1
question
Computers and Technology, 25.06.2019 01:00
Your computer will organize files into order. alphabetical chronological size no specific
Answers: 2
question
Computers and Technology, 25.06.2019 07:20
Acompany's intranet is set up on this type of server. application communication print web
Answers: 1
question
Computers and Technology, 25.06.2019 08:10
Memory aids that organize information for encoding are
Answers: 3
You know the right answer?
Write a class named car that has the following fields: yearmodel. the yearmodel field is an int tha...
Questions
question
Mathematics, 18.11.2020 21:50
question
Mathematics, 18.11.2020 21:50
question
Chemistry, 18.11.2020 21:50
Questions on the website: 13722363