Home › Forums › C Programming › Oops! problem using c++
- This topic has 1 reply, 2 voices, and was last updated 16 years, 2 months ago by GWILouisaxwzkla.
- AuthorPosts
- October 9, 2008 at 9:30 am #2143ElissaNockParticipant
1. A book shop maintains the inventory of books that are being sold at the shop. The list includes details such as author, title, price, publisher and stock position. Whenever a customer want a book, the sales person inputs the title and author and the system searches the list and displays whether it is available or not. If it is not, an appropriate message is displayed. If it is, then the system displays the book details and requests for the number of copies required. If the requested copies are available, the total cost of the requested copies are displayed, otherwise the message “Required book is not in stock”. is displayed.
Design a system using a class “Book” with suitable member functions and constructors. Use new operator in constructors to allocate the memory space required.2. Improve the system design in question1. to include following features:
a) The price of the books should be updated as and when required. Use a private member function to implement this.
b) The stock value of each book should be automatically updated as soon as a transaction is completed.
c) The number of successful and unsuccessful transactions should be recorded for the purpose of statistical analysis. Use static data members to keep count of transactions. - October 14, 2008 at 4:48 pm #3463GWILouisaxwzklaParticipant
What type of data structure are you to use ( linked list ? ).
- AuthorPosts
- The forum ‘C Programming’ is closed to new topics and replies.