Anda di halaman 1dari 3

University of Gujrat

Narowal Sub-campus

Enterprise Application Development # 2


Assignment deadline Wednesday, 22nd Jan 2017, 11:55 PM
Read Guidelines carefully

A Movie Rental Store


Let us consider an application that keeps track of customers borrowing and returning movies at a
video rental store.

For simplicity's sake (assuming that the rental store is relatively small and the computer memory is
relatively large), the application loads the database of customers and rental items into computer
memory at the beginning of the execution. The rental item data includes the item title, quantity on
hand, and the item id. The customer data includes the customer name and phone number (with the
phone number used as the customer id), the number of movies the customer has borrowed, and
their ids.

To make it more interesting from the point of view of using inheritance, I will add the following
detail: The movie data is stored in a file with a letter indicating the movie category ("f" for feature,
"c" for comedy, "h" for horror). When the data is read into memory, the information about the
category is stored in numeric form (1 for feature, 2 for comedy, 3 for horror). When the movie
information is displayed on the screen, the category is displayed as a word ("feature" for feature,
"comedy" for comedy, "horror" for horror). When the data is stored back to the file, the movie
category is stored as a letter again.

When a customer brings a movie to the register to check it out, the store clerk enters the customer's
phone number for the search of the database. If the customer is not found, a message is displayed. If
the customer is found, the customer name and phone number are displayed along with the data
about the movies that the customer has on loan. After verifying the customer name, the clerk enters
the movie id. The quantity on hand for this movie is decremented by one and the movie id is added
to the list of ids of the movies borrowed by this customer.

If a barcode reader is used to enter the movie id, then the movie will definitely be found in the
database. In this prototype, when the movie id is entered manually, an error message is displayed if
the movie is not found.

When the customer brings a movie to the register to return it, the store clerk again enters the
customer phone number. When the customer record is displayed, the clerk enters the movie id. If
the id is found in the list of movies borrowed by the customer, it is deleted from the list, and the
quantity on hand for that movie is incremented by one. If the movie id is entered incorrectly, an
error message is displayed.

For its reliability, we included the monetary aspect of the program (charging rental fees and late
fees), the performance part of the program (accumulating the indicators of demand for each movie),
and the management part of the program (adding, deleting, and editing customer and movie data).
University of Gujrat
Narowal Sub-campus

Requirements:

 Each class entity containing all its members


 A UML Diagram showing relationship of your classes (Inheritance, Composition etc.)
 Map the UML diagram to C++ code
 Sample output according to your plan
Sample input file with movie data. (A sample input file with movie data. Each line in the file
corresponds to one item: movie title (left-aligned), id number, quantity on hand, and category (as a
letter).)

Sample input file with customer data. (Shows a sample input file with customer data. Each customer
is allocated two lines. The first line contains the customer name and the customer phone number.
The second line contains the number of movies the customer has on loan and the list of movie
access numbers.)

Sample output file with movie data.

Sample output file with customer data. (Shows the contents of the customer file after the program
run. It indicates that customer returned the movie with the id number 101 and checked out the
movie with the id number 103.)
University of Gujrat
Narowal Sub-campus

Example of the execution of the program

Guidelines
 A single violation of guideline will lead to Zero mark in your assignment.
 You are encouraged to take help from Internet and books.
 Only ".doc" file should be uploaded to Piaza, Assignment should not be accepted via email, face
book or USB flash drive etc in worst case you can email the assignment but not after the due
time.
 Paste all the tasks from your .cpp files to the single .doc file.
 if you need to specify details please specify them in comments
 Do not zip your assignment it should be uploaded as individual file in following format.
 "RollNo_Assignment_2.doc"
 Deadlines should be kept in mind there would be no extension in assignment dates
 This is group assignment. PLAGARISM IS NOT ACCEPTABLE!
 Follow the instructions as it is otherwise your assignment would not be accepted at all.

Anda mungkin juga menyukai