Write a program for a car dealership that has a database

Assignment Help Programming Languages
Reference no: EM131959251

Assignment

Write a program for a car dealership that has a database of information for different automobiles. Each automobile has one or more attributes associated with it (color, Looks sporty, etc.). The number of attributes that each automobile has is not known at this time (and can be different for each). The program needs to accept commands with the goal of providing a list of automobiles that fit your criteria.

Input:

1. The list of automobiles and attributes should be stored in a file called autodata.txt. This file is to be read at the beginning each time your program is run (if it exists). Your program will create this file. The format for this file shall be:

NameCar1,Attribute1,Attribute2,... NameCar2,Attribute1,Attribute2,...

This is just a comma separated list with the car name first followed by all of its attributes. I will also check your programs with a data file that I generate so the file MUST be in this format.

2. The input formats as well as the commands are in the table below. Also, the entire program shall not be case sensitive.
Output:

1. The responses to the user's commands.

2. Each time you execute the SHOW command, also place the results in a file called results.txt. This file can be any format, however, make sure it is labeled clearly. Also, this file should append these results to previous runs.

3. When new cars along with their attributes are added using the ADD command, this data must be persisted to the autodata.txt.

Commands:

Command How it is processed

ADD Adds a new automobile. Prompt user for car name and the list of attributes. Shall not work if in search mode

Search Puts program in search mode. Prompt for name of this search (should probably be a heading in the results.txt file).

hasFeature Prompt user to enter an attribute to look for. Then process your list of current cars that match this criterion. If there is only one car left, print out the name of this car and that you have found it (this case would terminate search mode). (Search Mode Only)

CheckAuto Input the name of an automobile and print out the attributes about it if it exists in our search list. (Search Mode Only)

Show Shows the current list of automobiles that match all of the features you have listed as criteria thus far. (Search Mode Only).

Exit Exits Search mode and resets all attributes that were entered.

Quit Save the autodata.txt file if automobiles have been added and exits the program.

Notes:

• This program must be written in C++ using classes with header files. Every function also needs to be properly documented.

• Main should only contain menu code. All other processing must be done in other classes.

• The number of attributes is not known, an array will not work here.

• The CheckAuto feature needs to be fast (a linked list will not work here). Use a binary search tree. This tree should be a copy of the original since it should only contain the vehicles that currently match all of the features that have been added for this search.

• The HasFeature does not have to be as efficient and can traverse the entire data structure to find matches and eliminate ones that don't (again, this should use the copy, why look at data that you have already eliminated).

Sample input (obviously a menu should be initially shown with the choices as well as again if an invalid input is entered. All the menu items typed are italicized):

Add

Name: Mazda 6 Attributes: AWD
V6
Looks Good Great gas mileage

Add
Name: Honda Pilot Attributes: Large
V6 AWD
Looks Like a Box

Add
Name: Corvette Attributes: Fast
Great sound system Looks Good

Add
Name: DeLorean Attributes: V6
Looks Good Stainless Steel body Has Flux Capacitor
Search
Name: Good Looking Car

hasFeature
feature: Looks Good

hasFeature
feature: V6

CheckAuto
Name: Corvette
Not Found

CheckAuto Name: DeLorean Attributes:
V6
Looks Good Stainless Steel body Has Flux Capacitor

Show Mazda 6 DeLorean

hasFeature
AWD

Car Found!!!!!
Mazda 6 is your car!

Quit.

Reference no: EM131959251

Questions Cloud

Design networked systems including an application : Design networked systems including an application of the principles of bandwidth, user expectations, communications requirements, scalability and selection.
What is the purpose and importance of financial analysis : What is the purpose and importance of financial analysis? What are financial ratios? Describe the "five-question approach" to using financial ratios.
Determine the non controlling in subsidiary income : The fair value of the machine is $65,900, and the remaining useful life is estimated to be 10 years.
Compute the geometric average annual return : Compute the geometric average annual return for the 5 companies using daily/monthly % change in share price.
Write a program for a car dealership that has a database : Write a program for a car dealership that has a database of information for different automobiles. The list of automobiles and attributes should be stored.
Classify assets and liabilities as current and noncurrent : The balance sheet of a company does not classify assets and liabilities as current and noncurrent.
Gross sales to the markets organizers : How many pies will she need to sell to cover her fixed costs and realize a $10,000 profit? (input the number only and round up to the nearest pie)
Calculate the price of the bond and create an amortization : The bonds are dated January 1, 2012, mature January 1, 2015, and pay interest on June 30 and December 31 of each year.
Prepare the journal entry to record intrest on december : On January 1, 2016, Bishop Company issued 10% bonds dated January 1, 2016 with a ace amount of 1,000,000. The bonds mature in 2020 (5 years).

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd