Please also view images ( I really need help comparable interface, compareTo, part b, and part c) The main idea behind this activity is to extend Project 1. Create a system that allows a bookstore owner to keep track of their inventory and members utilizing inheritance.  In this checkpoint, you will be expanding the previous assignment in two significant ways. This assumes you have a working version of the Bookstore project from the previous assignment.  Recap The same rules apply from Project 1: The owner of a bookstore has asked for your help designing a system that allows them to keep track of the store’s inventory and members.  The owner provides you with the following details about what their store currently offers: The store sells three types of products: books, CDs, and DVDs. The store offers two types of memberships to customers: regular memberships and premium memberships. The regular membership is free, while the premium members pay a fee every month. The store keeps track of whether the monthly fee is due or has been paid for their premium members  The store keeps track of the members and their transactions (number of items purchased,  total purchases, ...) regardless if they are regular or premium members. The store also keeps track of the inventory of each product.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Please also view images ( I really need help comparable interface, compareTo, part b, and part c)

The main idea behind this activity is to extend Project 1. Create a system that allows a bookstore owner to keep track of their inventory and members utilizing inheritance. 

In this checkpoint, you will be expanding the previous assignment in two significant ways. This assumes you have a working version of the Bookstore project from the previous assignment. 

Recap

The same rules apply from Project 1:

The owner of a bookstore has asked for your help designing a system that allows them to keep track of the store’s inventory and members.  The owner provides you with the following details about what their store currently offers:

  • The store sells three types of products: books, CDs, and DVDs.
  • The store offers two types of memberships to customers: regular memberships and premium memberships. The regular membership is free, while the premium members pay a fee every month.
  • The store keeps track of whether the monthly fee is due or has been paid for their premium members 
  • The store keeps track of the members and their transactions (number of items purchased,  total purchases, ...) regardless if they are regular or premium members.
  • The store also keeps track of the inventory of each product. 
Update your design to utilize inheritance when representing the different items the store sells.
At a minimum your design should incorporate a Product class that is sub-classed into the three
different items available for purchasing - books, CDs, and DVDs.
The Product class must be an abstract class that implements the Comparable interface. Since
we never really need to instantiate objects of the type Product it makes it a good candidate for
abstraction. When comparing products we want that to be either based on the price of the
product or the amount in stock. Choose one of those attributes and implement the compareTo
method to work based on that field.
Part B - More Interfaces (10 points)
In this part you want to update your Bookstore program to implement the following interface:
BookStoreSpecification
public interface BookstoreSpecification {
}
/**
* given a product id and a product quantity, update
* stock by adding amount to existing product quantity
*
* @param productId
* @param amount
* @return
*/
public int restockProduct (int productId, int amount);
/**
* calculate and return dollar amount for current inventory of products
* that is in stock
*
* @return total in stock value
*/
public double inventoryValue();
Transcribed Image Text:Update your design to utilize inheritance when representing the different items the store sells. At a minimum your design should incorporate a Product class that is sub-classed into the three different items available for purchasing - books, CDs, and DVDs. The Product class must be an abstract class that implements the Comparable interface. Since we never really need to instantiate objects of the type Product it makes it a good candidate for abstraction. When comparing products we want that to be either based on the price of the product or the amount in stock. Choose one of those attributes and implement the compareTo method to work based on that field. Part B - More Interfaces (10 points) In this part you want to update your Bookstore program to implement the following interface: BookStoreSpecification public interface BookstoreSpecification { } /** * given a product id and a product quantity, update * stock by adding amount to existing product quantity * * @param productId * @param amount * @return */ public int restockProduct (int productId, int amount); /** * calculate and return dollar amount for current inventory of products * that is in stock * * @return total in stock value */ public double inventoryValue();
}
public double inventoryValue();
Notice that this interface has only two methods: restockProduct (int, int) and inventoryValue().
If you have a Bookstore class this might be a good option to implement this interface. Where
you implement this is highly dependent on your project design. You might have a separate
inventory management class that might be a better place to implement this interface. Keep in
mind that with computational problem solving and design there are many ways of achieving a
solution. Explore and have fun with it!
Part C- Changing the Test Harness (6 points)
Update your Test Harness class to include menu options to test the functionality added in Parts
A (Comparing products) and B (restock a product and display inventory total). Keep in mind
here that you can add helper methods to your class to make the code cleaner and easier to
debug.
Part D-Coding Style and Documentation (4 points)
This grade is awarded for proper coding styles. This includes:
• Appropriate prompts and informative output
●
• Appropriate method, variable and object names
• Proper indentation
Proper java documentation
• Good commenting (explains what code is doing)
Well-organized, elegant solution
●
Submission Requirements:
1. Submit your project export (lastNameFirstNameProject2.zip) that includes your program to
fulfill the requirements.
Transcribed Image Text:} public double inventoryValue(); Notice that this interface has only two methods: restockProduct (int, int) and inventoryValue(). If you have a Bookstore class this might be a good option to implement this interface. Where you implement this is highly dependent on your project design. You might have a separate inventory management class that might be a better place to implement this interface. Keep in mind that with computational problem solving and design there are many ways of achieving a solution. Explore and have fun with it! Part C- Changing the Test Harness (6 points) Update your Test Harness class to include menu options to test the functionality added in Parts A (Comparing products) and B (restock a product and display inventory total). Keep in mind here that you can add helper methods to your class to make the code cleaner and easier to debug. Part D-Coding Style and Documentation (4 points) This grade is awarded for proper coding styles. This includes: • Appropriate prompts and informative output ● • Appropriate method, variable and object names • Proper indentation Proper java documentation • Good commenting (explains what code is doing) Well-organized, elegant solution ● Submission Requirements: 1. Submit your project export (lastNameFirstNameProject2.zip) that includes your program to fulfill the requirements.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY