Create an car class that will be used by a car shop to keep track of inventory. The following attributes should be present in your automobile class: -private string make -private string model -private string color -private int year -private int mileage. The program should have methods such as: -default constructor -parameterized constructor -add a new vehicle method -list vehicle information (return string array) -remove a vehicle method -update vehicle attributes method. All methods should include try..catch constructs. Except as noted all methods should return a success or failure message (failure message defined in "catch"). 1. Create an additional class to call your automobile class (e.g., Main or AutomobileInventory). Include a try..catch construct and print it to the console. 2. Call automobile class with parameterized constructor (e.g., "make, model, color, year, mileage"). a) Then call the method to list the values. Loop through the array and print to the screen. 3. Call the remove vehicle method to clear the variables. a)Print the return value. 4. Add a new vehicle.     a)Print the return value.     b) Call the list method and print the new vehicle information to the screen. 5. Update the vehicle.     a) Print the return value.     b)Call the listing method and print the information to the screen. 6. Display a message asking if the user wants to print the information to a file (Y or N).      a) Use a scanner to capture the response. If "Y", print the file to a predefined location (e.g., C:\Temp\Autos.txt). Note: you may want to create a method to print the information in the main class.      b) If "N", indicate that a file will not be printe

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Create an car class that will be used by a car shop to keep track of inventory. The following attributes should be present in your automobile class:

-private string make
-private string model
-private string color
-private int year
-private int mileage.


The program should have methods such as:

-default constructor
-parameterized constructor
-add a new vehicle method
-list vehicle information (return string array)
-remove a vehicle method
-update vehicle attributes method.


All methods should include try..catch constructs. Except as noted all methods should return a success or failure message (failure message defined in "catch").

1. Create an additional class to call your automobile class (e.g., Main or AutomobileInventory). Include a try..catch construct and print it to the console.

2. Call automobile class with parameterized constructor (e.g., "make, model, color, year, mileage").
a) Then call the method to list the values. Loop through the array and print to the screen.

3. Call the remove vehicle method to clear the variables.
a)Print the return value.

4. Add a new vehicle.
    a)Print the return value.
    b) Call the list method and print the new vehicle information to the screen.

5. Update the vehicle.
    a) Print the return value.
    b)Call the listing method and print the information to the screen.

6. Display a message asking if the user wants to print the information to a file (Y or N).
     a) Use a scanner to capture the response. If "Y", print the file to a predefined location (e.g., C:\Temp\Autos.txt). Note: you may want to create a method to print the information in the main class.
     b) If "N", indicate that a file will not be printed.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Unreferenced Objects
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education