Expert answer:the requirements as followed.Implement a simple cruise liner reservations system as a proof-of-concept prototype for future work on a larger system. The program will provide a simple text based interface that will allow the user to enter attributes associated with a given reservation. The program will manage these attributes in an object, which will consist of an individual node within a single linked list stored in memory. The linked list can be a global variable for simplicity, as done in the Book Inventory sample program. The program must use the “list” API in the C++ standard template library (STL). The program must implement at least one class to hold the following variables (input validation is only required where indicated):more details in the file.
requirements_.docx
sample_programs.zip
Unformatted Attachment Preview
This program consists of implementing an application using the techniques learned in the first
half of the course. Examples on how to use file operations, the standard template library, and
other features are provided in the Sample Programs (for Project 2) section located the
Modules area. These examples provide a starting point for your implementation. Everything
you need to do this project is provided in these sample programs.
Your program must compile and you must provide all of the source code files so that I can
also compile and run your program (i.e. provide me with all files ending in .h and .cpp that
are necessary to compile your program). You are responsible for submitting your program
correctly. Please ask if you have questions.
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 (20 points)
Implement a simple cruise liner reservations system as a proof-of-concept prototype for future
work on a larger system. The program will provide a simple text based interface that will
allow the user to enter attributes associated with a given reservation. The program will
manage these attributes in an object, which will consist of an individual node within a single
linked list stored in memory. The linked list can be a global variable for simplicity, as done in
the Book Inventory sample program. The program must use the “list” API in the C++
standard template library (STL). The program must implement at least one class to hold the
following variables (input validation is only required where indicated):
locaterId — A string variable used to identify the reservation within the linked list. This
identifier must be a unique randomly generated six- character string. For example: GTHYUR,
HQKALS, OPUYHA, etc.
1 departureMonth lengthOfCruise –
An integer variable to hold the desired departure month of the cruise. Input Validation
Required: The program must print an error and re- prompt the user to re-enter the month if it
is not a number between 1 and 12.
An integer variable to hold a number key that indicates the desired length of the cruise. The
indicator will must be a number between 1 and 4 and will be defined as follows:
1=(1to2nights)
2=(3to5nights)
3=(6to9nights)
4 = (10 to 15 nights)
Input Validation Required: The program must print and error and re-prompt the user to reenter the number if it is not between 1 and 4.
An integer variable to hold the number guests.
A string variable for the first name of the guest who is making the reservation.
A string variable for the last name of the guest who is making the reservation.
A string variable for the street number and name of the billing address.
An integer variable to hold the 5-digit zip code of the billing address. For simplicity, leading
zeros are not allowed.
Input Validation Required: The program must print an error and re- prompt the user to reenter the zip code if the value entered is not a 5-digit number.
numberOfGuest –
firstName —
lastName –
billingAddress
zipCode
Provide the appropriate methods to set and get the data for each of the above class variables.
For example setLocatorId(string locatorId) and string getLocator(). The Book
Inventory provides an example on how this can be done. In addition, the main program must
provide the following functionality:
1. When the program is first started, it must read a data file called reservation.dat. The
program will not prompt the user for the name of the data file. The name of the data file must
be hard-coded in the program. If the file exists, the program will load the data for each
reservation into the global linked list. If the file does not exist, the program will start with an
empty linked list.
2. The program will provide a simple text-based user interface that manages the all of the
reservations within a linked list. Each reservation must be placed in the linked list as an object
that holds all of the attributes associated with it as mentioned above. The user interface will
allow the user to perform the following:
(a) EnterReservation–allowstheusertoenterallofthefieldsassociatedwithagivenreservation,
except for the locatorId, which will be automatically generated by the program as
previously mentioned. After the fields are entered, the program will place the reservation
object in the global linked list.
2
Hints and Tips
(b) Display Reservations – displays all of the reservations within the linked list along with
their associated fields. The program must also print the text associated with the
lengthOfCriuse variable in addition to its key. For example, a lengthOfCriuse with a
value of 2 would display “2 (3 to 5 nights).” In addition, this option must print the total
number of reservations in the linked list.
(c) Search for Reservation – allows the user to find a reservation by its locator identifier. The
program will prompt the user to enter the locatorId and will display all of the fields
associated with the given reservation, if it is found. The program must display an error
message if the reservation is not found in the linked list.
(d) Edit Reservation – allows the user to edit the fields for a given reservation that is in the
linked list. The program must prompt the user to enter the locatorId as the key to find the
reservation to edit. Print a message if the reservation is not found in the linked list. For
simplicity, the program may re-prompt the user to re-enter all of the fields associated with the
given reservation; however, it must reuse the locatorId value.
(e) Delete Reservation – allows the user to delete a reservation from the linked list using the
locatorId
as the key. The program must display a message if the provided locatorId does
not find an associated reservation in the linked list.
(f) 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 in the object per line. At this
point, if the file does not exist, the program will create it.
The Book Inventory program provides a good place to start and I recommend using it as a
model. It provides a simple text based interface, shows how to create a class, and how to use
the C++ STL library’s linked list API for adding and displaying items in a linked list. You
should rename its files, the class, and methods as a starting point for your program.
Start by breaking the program down into small pieces. First, work on the feature that allows
you to enter a reservation along with all of its fields. Next, work on the display feature that
will show all of the reservations and their associated fields contained within the linked list.
Next, make sure your program can read and write one reservation and its fields to and from
the data file. Then expand the program to read and write all of the reservations to and from
the data file. The data file functions for this can be modeled after those in File Operations
sample program, and the display and enter functions that you will create. Finally, work on the
search, modify, and delete features. Be sure to review the sample code in the Sample
Programs (for Project 2) section in the Modules area in Canvas.
There are no tricks or special techniques required for this assignment. Everything you
need to successfully create this program is available in the provided sample code.
Book Inventory
This program provides an example on how to use common list operations in the
C++ Standard Template Library (STL), such as iterators and adding and deleting
elements from a list.
•
BookInventory.zip
File Operations
This program provides a partial implementation on how to read and write data
from a standard text file. This example program uses a global array. Your program
will not use an array.
•
FileOperations.zip
Random String
This program provides an example that generate a random string of letters.
•
RandomString.zip
Command Line Parse
This program provides an example on how to read command line arguments when
a program is run from the Windows command shell.
•
CommandLineParse.zip
Text Line Parse
This program provides and example on how to extract a single character command
(e.g. ‘A’, ‘E’, ‘O’, ‘U’, ‘Y’) and two numbers from a given line of user entered text.
•
TextLineParse.zip
Print Queue
This program provides and example on how to use the C++ STL queue data
structure.
•
PrintQueue.zip
…
Purchase answer to see full
attachment
You will get a plagiarism-free paper and you can get an originality report upon request.
All the personal information is confidential and we have 100% safe payment methods. We also guarantee good grades
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more