in this exercise, you will be including two classes: A class called CarDemo.java whose purpose is to house the main method. Another class called Car.java with the following components: 6 instance variables : (remember to give your variables private accessibility) String make; String model; int year; String color; double price; double speed; Mutator methods: setMake(), setModel(), setYear(), setColor(), setPrice(), setSpeed(). Accessor methods: getMake(), getModel(), getYear(), getColor(), getPrice(), getSpeed(). displayFeatures(): a void method that displays the values of the data members. To test your class, you will need to instantiate at least two different Car objects in the main method in the CarDemo class. Each of your objects should invoke the mutator methods to assign values to your fields. Invoke the displayFeatures() method for both objects and display the variables. Demonstrate the use of the accessor method getColor() by accessing the color of

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter10: Classes And Objects
Section: Chapter Questions
Problem 4RQ
icon
Related questions
Question
in this exercise, you will be including two classes: A class called CarDemo.java whose purpose is to house the main method. Another class called Car.java with the following components: 6 instance variables : (remember to give your variables private accessibility) String make; String model; int year; String color; double price; double speed; Mutator methods: setMake(), setModel(), setYear(), setColor(), setPrice(), setSpeed(). Accessor methods: getMake(), getModel(), getYear(), getColor(), getPrice(), getSpeed(). displayFeatures(): a void method that displays the values of the data members. To test your class, you will need to instantiate at least two different Car objects in the main method in the CarDemo class. Each of your objects should invoke the mutator methods to assign values to your fields. Invoke the displayFeatures() method for both objects and display the variables. Demonstrate the use of the accessor method getColor() by accessing the color of
Options
********** Car 1 ***
Make: Tesla
Model: Model X
Color: Red
Year: 2021
Price: $35999.0
Speed: 0.0 mph
******* Car 2 *****
Make: Honda
Model: Civic
Color: Black
Year: 2018
Price: $17999.0
Speed: 0.0 mph
*******Invoking getColor() method***********
The color of the first car is Red and the color of the second color is Black.
Transcribed Image Text:Options ********** Car 1 *** Make: Tesla Model: Model X Color: Red Year: 2021 Price: $35999.0 Speed: 0.0 mph ******* Car 2 ***** Make: Honda Model: Civic Color: Black Year: 2018 Price: $17999.0 Speed: 0.0 mph *******Invoking getColor() method*********** The color of the first car is Red and the color of the second color is Black.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Knowledge Booster
void method
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT