Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In Java. Also please the whole screenshot of the classes. TY Project Description In this project you will build a car configuration application in six
In Java. Also please the whole screenshot of the classes. TY
Project Description In this project you will build a car configuration application in six units. Each unit provides learning opportunities in Object Oriented Design. You are expected to document these lessons and apply them in next unit. You will notice that the design guidance will taper off as you progress through units in Project 1. You will be expected to design on your own. Project 1 - Unit 1 In this project you will build a Car Configuration Application. In this unit you will develop a "reference" base object model, read a text file to build the reference base object model and archive it using Serialization. I would like you start with a proof of concept - so we will first build the underlying object using normal Java Classes and Inner Classes. For our proof of concept please consider the following requirements: We will build Ford's Focus Wagon ZTW model with these options: - Color - Fort Knox Gold Clearcoat Metallic, Liquid Grey Clearcoat Metallic, Infra-Red Clearcoat, Grabber Green Clearcoat Metallic, Sangria Red Clearcoat Metallic, French Blue Clearcoat Metallic, Twilight Blue Clearcoat Metallic, CD Silver Clearcoat Metallic, Pitch Black Clearcoat, Cloud 9 White Clearcoat - Transmission - automatic or manual - Brakes/Traction Control - Standard, ABS, or ABS with Advance Trac - Side Impact Air Bags - present or not present - Power Moonroof - present or not present Configuration options and cost data: Your Deliverable: Design and code classes for these requirements and write a driver program to instantiate a Ford Wagon ZTW object and write it to a file. Test your code with a couple of instances of Forward Wagon ZTW. Step 1 - Analysis 1. Analyze data and create a set of classes. 2. From the data provided in project description you can try to find patterns in structuring information. You will notice that: a. Each model (Ford Wagon ZTW) definition has a set of properties (Color, Transmission etc.) b. Each property has a set of values (For color there are different values like Fort Knox Gold Clearcoat Metallic etc.) c. Each property has a price. d. Model also has a price. e. Values for each property tend to be different in quantity. Step 2 - Designing Classes 1. Using the information in the last step (Analysis) you can start designing classes and how each might relate. 2. We will certainly not create classes for each property as that will not be reusable design. 3. We can create a Model class that can hold name of the model, base price and information about all the properties (Let's call it OptionSet) 4. Each OptionSet has a set of values. Each value can be defined in its own class (Let's call it Option). Each Option can have name and price as properties. 5. Each OptionSet will also have a name. Step 3 - Define Class relationships for class Model package 1. We can see that Model will contain OptionSet and Each OptionSet will contain Option class. 2. For practice and learning purposes be sure to make Option class an Inner class of OptionSet. 3. The structure at a high level might look like this: class Automotive \& //This class will represent the Model. String name; OptionSet opset[] ; Model(int size, String n ) \{ opset = new OptionSet[size]; name =n; class OptionSet \{ Option opt []; String name; OptionSet (String n, int size) \{ opt = new Option[size]; name =n; \} \} class Option String name; float price; \} 4. In the above code you will notice that Each model has a set of OptionSets. Each OptionSet has a set of Options. 5. For each Array object (opset and opt) you will need to instantiate objects to avoid NullPointerException. for(int i=0;iStep 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