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 numbersofLikes =0; 1/ initialize the rest E.g., thio.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

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions