Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The movie rental system you developed in HW1 relied on arrays. Hence, the system had limited flexibility in adding/deleting new movies or adding/deleting customers from

The movie rental system you developed in HW1 relied on arrays. Hence, the system had limited flexibility in adding/deleting new movies or adding/deleting customers from the executable. You will be re-designing the system using linked lists so that movies or users can be added or deleted during run time. Additionally, the new program must allow a customer to rent any number of movies. You need to modify the array based implementation to an implementation based on two linked lists as shown below. The customers are stored in a nested linked list called as customerList. Each customer has a movieList, where the movies rented by him/her are stored. The movie catalog is another linked list termed as moviesToRentList. All lists are maintained in the alphabetical order of the names. You need to implement the functions to manipulate the linked lists as well as routines to add and delete nodes in the linked list. HW4: Linked list based movie rental system Arrival / customerList B. Schweer E. Mou / / Moana Sing / La La Land moviesToRentList Passengers Underworld / B. Evans Name moviePtr nextPtr RentalCustomerNode movieNode Name nextPtr All lists need to be maintained in alphabetical order Add/Delete customers & Movies

The system menu has eight options: 1. Status. 2. Return Movie. 3. Rent Movie. 4. Add User. 5. Delete User. 6. Add Movie. 7. Delete Movie. 8. Exit. If option 1 (Status) is selected, the program will print three sections: (1) customers names and the movies rented by them (if any) in alphabetical order , (2) the total number of movies that are currently in circulation, (3) the catalog movies available for checkout (i.e. only the movies that are not currently rented by another user).

If option 2 (Return Movie) is selected, the program will print the list of registered customers and request the customer number. Once the customer is selected the movie is returned to the store and will be made available to rent by another customer.

If option 3 (Rent Movie) is selected, the program will ask to identify the customer from the list of registered customers. Once the customer is selected, the system will present the list of available movies to rent and ask to select one of them. Once the movie is selected, the system marks the movie to be rented to the customer and removes it from the available list of rentals and returns to the main menu. 1 Homework 4: Movie rental system using linked lists (Individual) due Friday, March 31, 2017, 11:59 p.m.

If option 4 (Add User) is selected, the program will ask the user name. A new user with the specified name will then be added to the list of users.

If option 5 (Delete User) is selected, the system will ask the user to identify the customer from the list of registered customers. Once the customer is selected, the system will return all the movies rented by the customer (if any) to the list of movies available for rent and delete the customer.

If option 6 (Add Movie) is selected, the program will request the name of the movie to be added. A new movie with the specified name will then be added to the catalog.

If option 7 (Delete User) is selected, the system will ask the user to identify the movie from the available rentals; the movies that are with customers cannot be deleted. Once the movie is selected, the system will delete it from the catalog.

If option 8 (Exit) is selected, the system delete all the dynamic memory that is allocated and terminate the program. Your task in homework 1 is to write a C++ program to implement the above menu-based movie-rentalreservation system.

The definition of the nodes of the lists are provided to you in the HW4 folder on SVN. For simplicity, you can hardcode the initial user and movie list as in HW1 & 2. Some additional general requirements follow: You must implement your program in the file named hw4.cpp within your hw4 folder in your homework directory. You must include a standard documentation block (to include programmer, filename, and a brief description of the program) at the top of your file and include comments throughout the program. You are required to split the functionality into multiple helper functions to make the code re-usable and easy to debug. A brief documentation block must be included for each of the functions to briefly describe the purpose of the function along with any inputs/outputs. The file hw4.cpp should only contain the logic for the menu; the functions to add/delete/rent/return/print movies and customers should be distributed between Movie.cpp, RentalCustomer.cpp and helperfunctions.cpp. The homework should work with any number of users and any number of movies. (provided the computer has enough memory) From a users perspective, the movies must range from 1 to 12 (and not, for instance, from 0 to 11). Internally, you may maintain any convention you like (e.g., 0 to 11); you must ensure that any time the program prints/reads movies/users, the numbering convention is maintained. Ensure that any dynamic memory that is allocated during run time is deleted at appropriate times

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

Step: 3

blur-text-image

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

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago