Obeject-oriented Design: a DVD renting library system

5385 ワード

Design a DVD renting library system
 1 class DVD

 2  {

 3     int id;

 4     double price;

 5     string  Name;

 6     int  status;  // Availabe(or) Rented

 7     string customer; // custid

 8     string  StartDate; // Rent Start Date

 9     string  Enddate;  // Rent End Date

10    

11   public:

12     // get,set methods

13 }

14 

15 

16 class DVDLibrary

17 {

18    // map of dvd id and pointer to DVD object

19    map<int,DVD *>   collection1;

20 

21    // multimap of name of DVD to dvd id

22    multimap<string,    int>   collection2;

23 

24   public:

25    //methods to modify collection1 and collection2

26 }

27 

28 class Customer

29 {

30    string customer;

31 

32    list<DVD *>   dvdlist;

33    

34    list<Payment *> paymentlist;

35 

36  public:

37   //methods

38 }

39 

40 class Payment

41 {

42    string customer;

43 

44    float  amt;

45  

46    string paymentdate;

47 

48   public:

49   // methods

50 }