Obeject-oriented Design: a DVD renting library system
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 }
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。