Vous êtes sur la page 1sur 2

CIS278 Project 7 You are writing a simple application to help Joes Marina keep track lending materials which

are made available for marina occupants. The Marina Cafe keeps a wide selection of books and DVDs for borrowing and would like to automate their record keeping. The following diagrams describe the classes !ou will need for this pro"ect. #end$tem
- string title //PRIVATE member variables - char mediumType (B !r " # - b!!l b!rr!$ed - int b!rr!$%umber &endItem( # &endItem(string titl' char med# v!id setTitle(string manu# v!id set(edium(char med# v!id setB%umber(int b%umber# v!id setB!rr!$ed(b!!l bstatus# b!!l getB!rr!$ed(# string getTitle(# char get(edium(# int getB%umber(# virtual v!id printAll(!stream)#*+, !stream) !perat!r--(!stream) !ut' c!nst &endItem) !b.#

% % % &ook
4 4 4 4 4 4 4 auth!r/ string c!verType/ char (0 !r 1 # B!!5(#, B!!5(string titl'string auth'char c!ver# v!id setAuth!r(string auth# v!id set6!ver(char type# string getAuth(# char get6!ver(# v!id printAll(!stream)# 4 4 4 4 4 4 4

% % % DVD
- rating/ string - screenType/ char (2 !r 3 # "V"(#, "V"(string titl'string rating'char stype# v!id setRating(string rate*7P87# v!id set0creen(char type# string getRate(# char getType(# v!id printAll(!stream)#

'art $ ()* points+ You will first need to code #end$tem &ook and DVD classes. ,s !ou can see #end$tem is the base class from which the &ook and DVD classes inherit. The two derived classes describe two -t!pes of #end$tems. .ote that the #end$tem class is an abstract class. The #end$tem class provides a constructor which initiali/es its member variables in addition to accessor methods for each. 0ach of the e1tending classes provide additional data members specific to the t!pe of item plus additional methods needed to maintain the ob"ect. The 22 operator overload should output the name of the item and whether it is currentl! borrowed or not. $f it has been borrowed the id number of the borrower is printed. 0ach of these classes provides a 'rint,ll function to printout ,## item details included borrowed status.

'art $$ (3* points+ You are to write an ,''#$C,T$4. which will allow the user to store books and DVD information. Your program should allow the user to do an! of the following until the user decides to exit: enter new &ook enter a new DVD borrow a &ook or DVD user provides title of item to be borrowed print out the title and borrowed status of all &ooks currentl! stored print out the title and borrowed status of all DVDs currentl! stored accept a title as input and output a message indicating if that item is owned b! the marina and if so is available to borrow accept a title as input and output all stored information about that title accept an author name as input and output the title of all books b! the author which are owned b! the marina output the name onl! of all items which are currentl! owned but unavailable (ie have been borrowed+

0ach ob"ect created must be stored for the remainder of the program so !ou will need to have an arra! for DVDs and an arra! for &ooks. (,s both &ooks and DVDs are both #end$tems !ou can store all ob"ects in one arra! of t!pe #end$tem5 . A single array is not required here, however code will be much sim li!ied i! an array o! ty e "endItem# is used to store all $oo% and &'& objects( You are to submit !our #end$tem DVD and &ook class files in addition to the main application file.

Vous aimerez peut-être aussi