Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

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.

 

 

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M92063662
  • Price:- $45

Priced at Now at $45, Verified Solution

Have any Question?


Related Questions in C/C++

1 implement the binary search tree bst in c using the node

1. Implement the Binary Search Tree (BST) in C++, using the Node class template provided below. Please read the provided helper methods in class BST, especially for deleteValue(), make sure you get a fully understanding ...

What are the legal requirements with which websites must

What are the legal requirements with which websites must comply in order to meet the needs of persons with disabilities? Why is maximizing accessibility important to everyone?

Project - space race part a console Project - Space Race Part A: Console Implementation

Project - Space Race Part A: Console Implementation INTRODUCTION This assignment aims to give you a real problem-solving experience, similar to what you might encounter in the workplace. You have been hired to complete a ...

Why do researcher drop the ewaste and where does it end

Why do researcher drop the ewaste and where does it end up?

Assignment word matchingwhats a six-letter word that has an

Assignment: Word Matching What's a six-letter word that has an e as its first, third, and fifth letter? Can you find an anagram of pine grave. Or how about a word that starts and ends with ant (other than ant itself, of ...

Software development fundamentals assignment 1 -details amp

Software Development Fundamentals Assignment 1 - Details & Problems - In this assignment, you are required to answer the short questions, identify error in the code, give output of the code and develop three C# Console P ...

Assign ment - genetic algorithmin this assignment you will

ASSIGN MENT - GENETIC ALGORITHM In this assignment, you will use your C programming skills to build a simple Genetic Algorithm. DESCRIPTION OF THE PROGRAM - CORE REQUIREMENTS - REQ1: Command-line arguments The user of yo ...

Question 1find the minimum and maximum of a list of numbers

Question: 1. Find the Minimum and Maximum of a List of Numbers: 10 points File: find_min_max.cpp Write a program that reads some number of integers from the user and finds the minimum and maximum numbers in this list. Th ...

There are several ways to calculate the pulse width of a

There are several ways to calculate the pulse width of a digital input signal. One method is to directly read the input pin and another method (more efficient) is to use a timer and pin change interrupt. Function startTi ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As