You are on page 1of 3

Find study resources 숿

Question 숤 Answered step-by-step

Please see an attachment for details

Image transcription text


섘 1. 1. Create four (4) Java classes named Color, Model, Car,

and CarDemo. 2. In the Color class, create an enum named

CarColor that consists of six (6) colors of your ... Show more

Computer Science Engineering & Technology Java Programming 섈 쉋

Answer & Explanation Solved by verified expert 숨 Rated


싙 Helpful

Sample Output:
Car is a 2014 BLUE SUV

Car is a 2017 RED CONVERTIBLE

Step-by-step explanation

Program:
 
Color.java

enum CarColor{

RED,

GREEN,

BLUE,

YELLOW,

BLACK,

WHITE

 
Model.java

enum CarModel{

SEDAN,

SUV,

CONVERTIBLE,

HATCHBACK

 
Car.java
public class Car {

Find study resources 숿


int year;

CarColor color;

CarModel model;

public Car(int yr, CarModel m, CarColor c) {

year = yr;

color = c;

model = m;

public void display(){

System.out.println("Car is a "+year+" "+color+" "+model);

 
CarDemo.java

public class CarDemo {

public static void main(String[] args) {

Car car1 = new Car(2014, CarModel.SUV, CarColor.BLUE);

Car car2 = new Car(2017, CarModel.CONVERTIBLE, CarColor.RED);

car1.display();;

car2.display();

 
 
Sample Output:

Image transcription text


섘 Car is a 2014 BLUE SUV Car is a 2017 RED CONVERTIBLE

Student reviews 싙 78% (9 ratings)

Answered all questions Accurate answer Thorough explanation Great formatting Prompt response

"Answered all questions. Accurate answer. Great formatting. Prompt response"

Is this answer helpful? Helpful 싙 Unhelpful 싗


Report this answer

Add to library

Computer Science
/ Engineering & Technology
/ Java Programming
/ Please see an attachment for details

Related Answered Questions

숵 Q: Java Programming, please solve the 3 problems listed below, leave comments in code when needed. Grading Policy for probl

숵 Q: Java programming. Please give me handwritten answers.. 1. Write a Java code to implement two classes : Lecturer List and

숵 Q: I need help with my Java programming, If anyone could provide me the code; I would really appreciate your help.. Social
Find study resources 숿
숵 Q: java programming if you need more info let me know I need to creat a Random walk by javafx . On a random walk, start wit

숵 Q: Java Programming Please assist. Will be using Eclipse IDE to implement the code. Due Thursday by 11:59pm Points 100 Subm

See more 쇵

Can't find your question?

Ask a new question

Related Course Resources

EDU MISC BSIT 141

St. John's University STI College (multiple campus… S

섵 4197 Documents 섵 3549 Documents 섵

❓ 11 Question & Answers ❓ 15 Question & Answers ❓

솩 솩 솩 솩 솩 솩

Company Get Course Hero Careers

About Us iOS Leadership


Scholarships Android Careers
Sitemap Chrome Extension Campus Rep Program
Q&A Archive Educators
Standardized Tests Tutors
Education Summit

Help Legal Connect with Us

Contact Us Copyright Policy College Life


FAQ Academic Integrity Facebook
Feedback Our Honor Code Twitter
Privacy Policy LinkedIn
Terms of Use YouTube
Attributions Instagram

Copyright © 2022. Course Hero, Inc.


  Privacy
  Terms

Course Hero is not sponsored or endorsed by any college or university.

You might also like