(Solved) : Graded Activity Creating Classes White Class Ased Car Following Lds Make Make Feld Reflere Q37161836 . . .

Graded Activity-Creating Classes White a class ased Car that has the following lds – make The make feld reflerences a String object that holds the makeof speed The speed field is an int hat hoids the cars cument speed The class should have the followling constructor and other method Na-arg constructor that sets yearModel to 203k make to “Toyota”, pend to Parameterired constructor. The constructor should accet the car’s year model and make as arguments These values should be assigned to the object’s yearlMadel and make Selh 0 to the speed field Copy constructor that creates a cepy of an existingobject Accessers. Appropriate accessor methads should get the vallues stored speed ields 。getMake method that ums the val” in the make feld o getSpeed method that neturns the value in the speed feld Mutaters. Appropriate accessor methods should get the walues stored inan speed fields o setMake method that accepts a String argument, which is asigned to the make fleld o setspeed method that accepts an int argument, which is annigned to the speed feld avalue less than 0 s passed, the method should set speed to D accelerate. The accelerate method should add 5 to the speed fild each time it s called It accepts no argument The brake method thould subtract 5 tomthe speed fed each sled also deks updated brake. optional) toString method that returms the values stored in the car ojet in the fulowing String format the speed of 2018 modeled Toyota is o (optional equals method to test to see whether or not two car objects anehesame Demonstrate the class in a program that creates two Car objects one with deuitcontrto,one with value user. And then calls the accelerate method five times on the ist created object. After each entered by all to the accelerate method, get the current speed of the car and diglayiThem call he brakemve alto the brake method, get the cument speed of the car and play Graded Activity -Creating Classes 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 flield is an int that holds the car’s current speed. The class should have the following constructor and other methods. No-arg constructor that sets yearModel to 2018, make to “Toyota”, speed to o. Parameterized 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 Copy constructor that creates a copy of an existing object. Accessors. Appropriate accessor methods should get the values stored in an object’s yearModel, make, and speed fields getYearModel method that returns the value in the yearModel field getMake method that returns the value in the make field getSpeed method that returns the value in the speed field Mutators. Appropriate accessor methods should get the values stored in an object’s yearModel, make, and speed fields setYearModel method that accepts an int argument, which is assigned to the yearModel field setMake method that accepts a String argument, which is assigned to the make field setSpeed method that accepts an int argument, which is assigned to the speed field. If a value less than O is passed, the method should set speed to 0 o o o .accelerate. The accelerate method should add 5 to the speed field each time it is called. It accepts no argument brake. The brake method should subtract 5 from the speed field each time it is called. It also checks updated speed never gets a negative value(Assign the speed to 0, if it goes below 0) It accepts no argument (optional) toString method that returns the values stored in the car object in the following String format: the speed of 2018 modeled Toyota is 0 (optional) equals method to test to see whether or not two car objects are the same Demonstrate the class in a program that creates two Car objects, one with default constructor, one with value entered by the user. And then calls the accelerate method five times on the first created object. 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. Show transcribed image text Graded Activity-Creating Classes White a class ased Car that has the following lds – make The make feld reflerences a String object that holds the makeof speed The speed field is an int hat hoids the cars cument speed The class should have the followling constructor and other method Na-arg constructor that sets yearModel to 203k make to “Toyota”, pend to Parameterired constructor. The constructor should accet the car’s year model and make as arguments These values should be assigned to the object’s yearlMadel and make Selh 0 to the speed field Copy constructor that creates a cepy of an existingobject Accessers. Appropriate accessor methads should get the vallues stored speed ields 。getMake method that ums the val” in the make feld o getSpeed method that neturns the value in the speed feld Mutaters. Appropriate accessor methods should get the walues stored inan speed fields o setMake method that accepts a String argument, which is asigned to the make fleld o setspeed method that accepts an int argument, which is annigned to the speed feld avalue less than 0 s passed, the method should set speed to D accelerate. The accelerate method should add 5 to the speed fild each time it s called It accepts no argument The brake method thould subtract 5 tomthe speed fed each sled also deks updated brake. optional) toString method that returms the values stored in the car ojet in the fulowing String format the speed of 2018 modeled Toyota is o (optional equals method to test to see whether or not two car objects anehesame Demonstrate the class in a program that creates two Car objects one with deuitcontrto,one with value user. And then calls the accelerate method five times on the ist created object. After each entered by all to the accelerate method, get the current speed of the car and diglayiThem call he brakemve alto the brake method, get the cument speed of the car and play
Graded Activity -Creating Classes 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 flield is an int that holds the car’s current speed. The class should have the following constructor and other methods. No-arg constructor that sets yearModel to 2018, make to “Toyota”, speed to o. Parameterized 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 Copy constructor that creates a copy of an existing object. Accessors. Appropriate accessor methods should get the values stored in an object’s yearModel, make, and speed fields getYearModel method that returns the value in the yearModel field getMake method that returns the value in the make field getSpeed method that returns the value in the speed field Mutators. Appropriate accessor methods should get the values stored in an object’s yearModel, make, and speed fields setYearModel method that accepts an int argument, which is assigned to the yearModel field setMake method that accepts a String argument, which is assigned to the make field setSpeed method that accepts an int argument, which is assigned to the speed field. If a value less than O is passed, the method should set speed to 0 o o o .accelerate. The accelerate method should add 5 to the speed field each time it is called. It accepts no argument brake. The brake method should subtract 5 from the speed field each time it is called. It also checks updated speed never gets a negative value(Assign the speed to 0, if it goes below 0) It accepts no argument (optional) toString method that returns the values stored in the car object in the following String format: the speed of 2018 modeled Toyota is 0 (optional) equals method to test to see whether or not two car objects are the same Demonstrate the class in a program that creates two Car objects, one with default constructor, one with value entered by the user. And then calls the accelerate method five times on the first created object. 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.
Expert Answer
Answer to Graded Activity-Creating Classes White a class ased Car that has the following lds – make The make feld reflerences a St…
OR