Question: Use Java and object-oriented programming techniques in your implementation. Your design should follow good object-oriented design principles such as: Single responsibility a class
Use Java and object-oriented programming techniques in your implementation. Your design should follow good object-oriented design principles such as:
• Single responsibility – a class should have responsibility for a single functionality of a program and that responsibility should be encapsulated by the class.
• Open/closed principle – classes or modules should be open for extension but closed for modification.
• Efficient and no redundancy – keep it simple.
The followings are the basic classes that MUST exist in your program. The responsibilities of each of the classes, as well as some of their properties and methods are suggested. You are free to select the data types and method signatures for the classes, and to add additional classes when necessary. Follow the naming conventions and use descriptive identifiers to name classes, methods, variables, and constants to make your programs easy to read and avoid errors.
Laptop:
Laptop is a subclass of the Product class. It contains additional instance variables to store the color, screen size, processor, memory (RAM), and storage size. Create a parameterized constructor that accepts values for every instance field for both the Laptop class and Product class (except the product status). Use the super() call to the constructor in Product passing the required parameters.
Add the getter/accessor and setter/mutator methods for each of the data fields.
A method to calculate the value of the inventory of a laptop. Charge 10% of the laptop's price for a return.
Override the toString() method to return the information of the laptop object as a String.
Step by Step Solution
3.41 Rating (151 Votes )
There are 3 Steps involved in it
Here is a simplified Java implementation based on the provided requirements and class specifications import javautilHashMap import javautilMap class P... View full answer
Get step-by-step solutions from verified subject matter experts
