Provide appropriate accessor methods to set and get the data

Assignment Help C/C++ Programming
Reference no: EM131309035

Assignment

Overview

This assignment consists of implementing an application using the techniques learned in the first half of the course. Examples on how to use file operations, random number generation, the standard template library.

Your program must compile and you must provide all of the source code files so that I can also compile and run your program (e.g. provide me with all files ending in .h and .cpp that are necessary to compile your program). You may use any resources, books, or notes. Apart from your textbook and provided examples, you must mention all resources that you use as comments next to the applicable lines of code or the appropriate functions within your source code or within the main comment at the top of your source code file.

Implementation

The program will consist of implementing a vehicle tracking system for a rental car company. The implementation will include several attributes related to each vehicle in the rental car company's inventory, and the data will be managed in a global linked list in memory. The program must use the "list" API in the C++ standard template library. All of the attributes associated with each vehicle will be stored as a single object within a global linked list data structure. The program must implement at least one class that will hold the following variables:

 

recordId -

An integer that consists of a number starting at 100 for the first vehicle in the linked list and automatically incremented by 1 for each subsequent vehicle entered into the linked list. The user will not enter this number.

VIN -

A string to represent a fictitious vehicle identification number (VIN) associated with the given vehicle. The fictitious VIN will consist of a randomly generated set of 17 characters and numbers. The fictitious VIN must be in the format:
CCCC###CC##CCC##C
where C is a randomly generated character and # is a randomly generated number. Again, the user will not enter the fictitious VIN.

year -

An integer consisting of the four digit year that the vehicle was made. The program must re-prompt the user to re-enter the year if it is not a valid four digit year from 1906 - 2016.

make -

A string to indicate the make of the vehicle. For example, Ford, Toyota, etc.

model -

A string to indicate the model of the vehicle. For example, F150, Prius, etc.

color -

A string to indicate the color of the vehicle.

mileage -

An integer to hold the current odometer mileage for the vehicle.

forSale -

A Boolean flag to indicate that the vehicle can be put up for sale. This flag will automatically be set by the program if the entered mileage is over 100,000 miles. The user will not enter the data for this field.

Provide the appropriate accessor methods to set and get the data for each of these class variables. For example setYear(int year) and getYear(). The main program must provide the following functionality:

When the program is first started, it must read a data file called rentalCars.dat. The program should not prompt the user for the name of the data file. If the file exists, the program will load the data for each vehicle entry into the global linked list data structure. If the file does not exist, the program will start with an empty linked list.

Provide a simple text-based user interface similar to the Book Inventory example that manages the all of the vehicle entries in the global linked list. Each vehicle entry must be placed in this global linked list as an object that holds all of the information
associated with a given vehicle. The program interface will allow the user to do the following:

Display Inventory - displays all of the vehicles in the global linked list. This feature will display all of the fields associated with the each vehicle entry. In addition it must also print the total number of vehicles that are in the linked list.

Enter Vehicle - allows the user to enter all of the fields associated with a given vehicle, except for the recordId, VIN, and forSale fields. These fields will be automatically generated by the program as previously mentioned. After the data fields are entered, the program will place the vehicle entry in the global linked list data structure that is kept in memory.

Delete Vehicle - allows the user to delete a vehicle from the linked list using the recordId as the key. The program will display a message if the entry is not found in the linked list.

Search by Make - allows the user to find and print all of the vehicles for given vehicle make. The program will prompt the user to enter the vehicle make and will display a message if there are no vehicles in the global linked list for a given vehicle make.

Modify Vehicle - allows the user to modify all of the fields for a given vehicle entry (except for the recordId, VIN, and forSale) in the linked list. The program must use the VIN as the key to find the entry to modify. For simplicity, the program may re-prompt the user to re-enter all of the fields associated with a vehicle; but it must reuse the recordId, VIN, and forSale values. Display a message if the vehicle is not found in the linked list.

Exit system - before the program exits, it must save all of the data in the linked list to the data file. I recommend using a standard text file with one field per line. At this point, if the file does not exist, the program will create it.

Hints and Tips

First, work on the feature that allows the user to enter a vehicle along with all of its fields. Next, work on the display feature that will show all of the vehicles and their associated data contained within the linked list. Next, make sure your program can read and write one record to and from the data file. Then expand the program to read and write all records to and from the data file. The data file functions for this can be modeled after those in File Operations example and the display and enter functions that you will create. Finally, work on the search, modify, and delete features.

 

 

Reference no: EM131309035

Questions Cloud

What would be the impact on interest rates : Many argue that this was the position of the U.S. economy in 2003. If the Fed decided to expand the money supply in the graph, what would be the impact on interest rates?
Write a competitive analysis in a marketing plan : Which is more important? A market analysis or a competitive analysis in a marketing plan?
Types of immigrants better for america : 1. Is it good or bad that immigrants are willing to work for less? Why? 2. Are some types of immigrants better for America than others? Why? 3. What are the differences in the effects of illegal vs. legal immigration?
What does this imply about the forward premium : Assuming interest rates in country A are normally substantially higher than interest rates in country B. What does this imply about the forward premium or discount of country B's currency?  Would you frequently hedge your exposure to B's currency?
Provide appropriate accessor methods to set and get the data : Provide the appropriate accessor methods to set and get the data for each of these class variables. For example setYear(int year) and getYear().
Convert generic headings to talking headings : From a preliminary outline for a report, you have the following major and minor generic headings.- Convert these to talking headings that you'll include in your final report.
What is the equivalent annual cost of the tool : A precision lathe costs $24,000 and will cost $34,000 a year to operate and maintain. If the discount rate is 16% and the lathe will last for 4 years, what is the equivalent annual cost of the tool?
Discuss about the business marketing : According to Lamb et al. (2014), business marketing differs from marketing to consumers only in terms of the use of the products or services - leaving out the consumer. Business marketing entails marketing to persons and businesses who will then o..
Role of a small-business consultant : Place yourself in the role of a small-business consultant. One of clients, Home Solutions, is considering opening two new stores. You know that businesses often experience cash flow problems due to continuous changes that occur in the industry, su..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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