Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Put together an automobile class that will be used by a dealership as a vehicle inventory program. The following attributes should be present in your

Put together an automobile class that will be used by a dealership as a vehicle inventory program. 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.

Your program should have appropriate methods such as:

  • default constructor
  • parameterized constructor
  • add a new vehiclemethod
  • 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. Put together an additional class to call your automobile class (e.g., Main or AutomobileInventory). Include a try..catch construct and print it to the console any errors.
  2. Call automobile class with parameterized constructor (e.g., "make, model, color, year, mileage").
  • Then call the method to list the values. Loop through the array and print to the screen.
  1. Call the remove vehicle method to clear the variables.
  • Print the return value.
  1. Add a new vehicle.
  • Print the return value.
  • Call the list method and print the new vehicle information to the screen.
  1. Update the vehicle.
  • Print the return value.
  • Call the listing method and print the information to the screen.
  1. Display a message asking if the user wants to print the information to a file (Y or N).
  • Use a scanner to capture the response. If "Y", print the file to a predefined location (e.g., C:\Temp\Autos.txt). Note: Use a method to print the information in the main class.
  • If "N", indicate that a file will not be printed.

Please show your source code and screenshots of the application executing the application and the results.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions

Question

Find maximum flow and minimum cut for the attached diagram. \f

Answered: 1 week ago

Question

Managing the marketing effort

Answered: 1 week ago