EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
expand_more
expand_more
format_list_bulleted
Bartleby Related Questions Icon
Related questions
Question
Having trouble figuaring out how to go about constructing this java
Transcribed Image Text:Requirements:
1. Class - Vehicle
Constructors:
Methods:
о Create a class named Vehicle.
。 Define private string variables for the vehicle's color, make, and model.
o
о
Define a private integer variable for the number of doors.
Define private double variables for the discount and price.
Implement a copy constructor that takes a Vehicle object as a parameter and initializes the fields
accordingly.
Implement a constructor that accepts all private fields and assigns them using the "this"
keyword.
Create a no-argument constructor that initializes all fields to default values.
Implement necessary accessor and mutator methods.
Implement a method to calculate the total price after applying the discount.
Override the toString method to provide a user-friendly representation of the vehicle.
2. Class Customer
Methods:
о
-
Create a class named Customer.
• Define private string variables for name, city, and state.
Implement necessary accessor and mutator methods.
Override the toString method for user-friendly output.
3. Class CarDealership
о
Create an aggregate class that utilizes the Vehicle and Customer classes.
Define private string fields for the store name and location.
Implement private ArrayList<Vehicle> to hold the vehicle inventory.
о Implement private ArrayList<Customer> to manage customer contacts.
Override the toString method to present dealership information clearly.
о
Transcribed Image Text:4. Class-Demo
Demonstrate the functionality of the dealership in a separate class called Demo.
о
о
Include the following functionality:
1. Add vehicles to the inventory - Allow the dealer to add multiple vehicles. Prompt the
dealer if they wish to add the same vehicle as previously entered. If so, utilize the copy
constructor; otherwise, prompt for new vehicle details.
add customers to the contacts
2.
3.
calculate vehicle prices
4.
view customer information
5. exit the program.
Create functionality using fields and methods implemented in the CarDealership class from step
3 above
5. Input Validation
о
Ensure users can input case-insensitive values to quit the program.
• Validate menu options to ensure that only valid selections are accepted, catching any invalid
inputs.
6. Output
о
Display vehicle information in a user-friendly format
Format prices to include dollar signs, two decimal places, and commas
о
Display customers and vehicles after creation to verify creation of objects
Expert Solution
Check MarkThis question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
bartleby
Step by stepSolved in 2 steps with 2 images
Knowledge Booster
Background pattern image
Recommended textbooks for you
- Text book imageEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTText book imageProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageText book imageMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
- Text book imageC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningText book imageProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningText book imageSystems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage Learning
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Text book image
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning