Answered step by step
Verified Expert Solution
Question
1 Approved Answer
AutoPark Class: must have an instance variable called name (a string) to store the name of the AutoPark. It should have a one-argument constructor that
AutoPark Class: must have an instance variable called name (a string) to store the name of the AutoPark. It should have a one-argument constructor that accepts a string to specify the name of the AutoPark. This class must also contain instance variables to store two objects of each of the previous five classes (10 items in total). The constructor for this class must create these instances of each class (using the constructors defined in those classes) to initialize these attributes. For storage purposes, you can use separate variables or arrays to store these items (e.g., one variable for each item or an array for each type of items, such as sedans, SUVs, tires etc.). For this assignment, you can hard-code the argument values for each of the item constructors (i.e., color, price etc.) or use a random number generator to randomly assign a reasonable value. This class should also have a void method called displayltems() that will print each item in park's inventory to the console in a readable format. Additiona
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started