Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

solve in java 1. Design and implement a class called Shoe that represents inventory data for a shoe: - manufacturer: String - name: String -

solve in java
image text in transcribed
image text in transcribed
1. Design and implement a class called Shoe that represents inventory data for a shoe: - manufacturer: String - name: String - price: double - number of likes: integer Represents how many people have clicked "like" on this shoe - colours: String[] You are required to define the following methods: - Constructors: Empty constructor that initializes each attribute with an initial value - Constructor that initializes attributes with its parameters - A constructor that creates an object and initializes all attributes excluding number of likes. Because the number of likes is not supplied, this version of the constructor should initialize likes with 0 public Show (String manufacturer, String name, double price, string[] colours) t numberaofLikes =0; /I initialize the reat D.g., thiz name = name; - A copy Constructor that performs deep copy. - Accessor/getter and Mutator/setter methods: A getter and setter for each attribute Note, the setColours() should not perform shallow copy - The like() method The method like() is a mutator method but it does not take a parameter. It sets the number of likes to +1 - tostring() method: - return all the attributes with meaningful hint/message for the user Driver - Implement a driver/main class such that you initialize/create 3 objects of Shoe. Use both constructors - Store the 3 objects in an array or array list - Use 1 setter, 1 getter - Like 2 objects such that it increases the number of likes by 1 each invocation - Finally, loop through the array/array list and print all data for each object by invoking toString()

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

5. Describe how contexts affect listening

Answered: 1 week ago