Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ 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

C++

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.

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.

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 deletes all the dynamic memory that is allocated and terminate the program. image text in transcribedimage text in transcribedimage text in transcribed

movies ToRentList B. Evans" T-La "B. Schweer'' "E. Mou" customerList La La Land "Moana Passengers "Underworld' Figure 1: Illustration of the linked lists to be used in the movie rental system movies ToRentList B. Evans" T-La "B. Schweer'' "E. Mou" customerList La La Land "Moana Passengers "Underworld' Figure 1: Illustration of the linked lists to be used in the movie rental system

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions

Question

SAP Business Warehouse does NOT use a snowflake model True False

Answered: 1 week ago

Question

Question Can I collect benefits if I become disabled?

Answered: 1 week ago

Question

Question May I set up a Keogh plan in addition to an IRA?

Answered: 1 week ago