Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that asks the user how many automobiles are to be described. Plz use simple Java language(BLUEJ is preferred) thank you 2. rafter

Write a program that asks the user how many automobiles are to be described. Plz use simple Java language(BLUEJ is preferred) thank you image text in transcribed
2. rafter 7.6-easy] Automobile Description Write a program that asks the user how many automobiles are to be described, and for each automobile it inputs the user's selection of make and color. Then it outputs color and make. you could do this easily using a simple procedural program, do it by using a main method in class AutomobileDriver to instantiate an object called auto from a class Automobile. Make your classes conform to the following UML class diagram: AutomobileDriver Automobile make : String color: String main(args: StringID: void setMake0 void setColorO: void printMake:void printColorO: void Let Automobile methods setMake and setColor do the prompting and inputting for make and color, and include input verification which asks again if a selection is illegal. Let Automobile methods printcolor and printMake print color and make on one line. In AutomobileDriver, after asking auto to call setMake and setcolor, use ) to chain the two printing methods. Write code so that the program can produce the following display: Sample session: How many cars do you want to consider? 2 Select Buick, Chevrolet, or Pontiac (b,c,p): x The only valid selections are 'b', 'c', or 'p' Select Buick, Chevrolet, or Pontiac (b,c,p): p Select blue, green, or red (b,g,r):r red Pontiac Select Buick, Chevrolet, or Pontiac (b,c,p): c Select blue, green, or red (b,g,r):g green Chevrolet

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions