(21) 2. Write a Java application that asks the user to enter a car model or 'done' when finished. If the user enters a car model, ask the user to enter the color of that car model. Store the cars and colors in ArrayLists of type String. When the while loop completes, use a for loop to print out the car and color as shown below:

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter9: Records (struct)
Section: Chapter Questions
Problem 16SA
icon
Related questions
Question
(21) 2. Write a Java application that asks the user to enter a car model or 'done' when finished. If the user enters a car model, ask the user to enter the color of that car
model. Store the cars and colors in ArrayLists of type String. When the while loop completes, use a for loop to print out the car and color as shown below:
Enter a car or 'done if done: Camry
Enter color of car: White
Enter a car or
'done' if done: Accord
Enter color of car: Blue
Enter a car or 'done' if done: done
car: Camry, color: White
car: Accord, color: Blue
Transcribed Image Text:(21) 2. Write a Java application that asks the user to enter a car model or 'done' when finished. If the user enters a car model, ask the user to enter the color of that car model. Store the cars and colors in ArrayLists of type String. When the while loop completes, use a for loop to print out the car and color as shown below: Enter a car or 'done if done: Camry Enter color of car: White Enter a car or 'done' if done: Accord Enter color of car: Blue Enter a car or 'done' if done: done car: Camry, color: White car: Accord, color: Blue
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Array
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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr