212k views
0 votes
Design a software system for a bookstore that keeps an inventory of two types of books: Traditional books and books on CD. Books on CD may also contain music. The bookstore purchases books from publishers and sets a price for each book. Customers can purchase books from the bookstore, using either cash or a credit. The bookstore keeps track of which books it has in its inventory, and the books purchased by each customer

a. What are the objects in your object- oriented Solution?
b. What are the interactions between objects in your solution?
c. Which objects "have" other objects?
d. Which Objects "Use" other objects?
e. Which objects are other objects?

User Scootklein
by
4.8k points

1 Answer

2 votes

Answer:

Step-by-step explanation:

a. In this scenario, the best solution would have an Object of Traditional Books, CD, Music, Bookstore and Customer.

b. All five objects would be able to be called by the main program loop and the Customer Object would call upon and use either the Books or CD object, While the Bookstore object would call upon all of the other objects.

c. Both the Bookstore object and Customer object will "have" other objects as the Bookstore needs to hold information on every Book or CD in the Inventory. While the Customer object would call upon the Book and CD object that they are purchasing.

d. The Music Object will extend the CD object and use information on the CD object as its parent class.

e. Since the Music Object extends the CD object it is also considered a CD since it is in CD format like the Books on CD and therefore is both objects.

User Alex Albu
by
4.7k points