Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How do you acomplish this assignment? Assignment List vs Set with GUI CSIS-1410 Console Output: List: side :14 #0000FF side :18 #FF0000 side : 12

image text in transcribed

image text in transcribed

How do you acomplish this assignment?

Assignment List vs Set with GUI CSIS-1410 Console Output: List: side :14 #0000FF side :18 #FF0000 side : 12 #FFFF00 side :18 #FF0000 side: 16 #00FF00 Learning Objectives: Implement equals and hashCode to compare objects of a custom class. User the internet to learn about the interfaces List and Set, and class HashSet Describe the differences between the interfaces List and Set Create, initialize, and display a HashSet Modify an existing GUI application based on specific instructions Demonstrate the benefits of separating functionality and display by using class ColoredSquare both in a console application and in a GUI application Set: side :14 side :12 side: 16 side :18 #0000FF #FFFF00 #00FF00 #FF0000 Description: Download the starter project and import it into Eclipse Import>Existing Projects Into Workspace Implement the classes ColoredSquare and ListVsSetDemo as described below. Uncomment the code in class ListVsSetConsoleApp to test your classes. This test client should not be changed. Once you verified that the classes ColoredSquare and ListVsSetDemo work as expected modify the Gui Application according to the description below Adding a new element: List: side: 14 #0000FF side :18 #FF0000 side : 12 #FFFF00 side :18 #FF0000 side : 16 #00FF00 side :10 #FFC800 Set: side: 14 #0000FF side : 12 #FFFF00 side :10 #FFC800 side : 16 #00FF00 side :18 #FF0000 Ad ColoredSquare: Implement ColoredSquare according to the UML diagram. No class members should be added or removed Important: ColoredSquare should NOT include any print methods Adding a duplicate element List: side: 14 #0000FF side :18 #FF0000 side : 12 #FFFF00 side : 18 #FF0000 side : 16 #00FF00 side :10 #FFC800 side :10 #FFC800 ColoredSquare side int color Color ColoredSquare (s int, c: Color) Hint: import java.awt.Color +area ():int equals ( Object obj): boolean +hashCode(): int toString() String equals 2 colored squares should be considered equal if and only if they have the same size and color. Use Eclipse to auto-implement equals and hashCode toString: The method toString should return a string as shown on the right. e.g. side: 14 #0000FF side : 12 #FFFFee etc. Notice: the toString method of Color displays the rgb values in decimal format. However, in our implementation we use a hexadecimal format like in HTML. Hint 1: To obtain the individual red, green, blue values check out class Color Hint 2: Info on how to format an integer as a 2-digit hexadecimal value Set: side :14 #0000FF side : 12 #FFFF00 side :10 #FFC800 side : 16 #00FF00 side : 18 #FF0000

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_2

Step: 3

blur-text-image_3

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

Pro SQL Server Administration

Authors: Peter Carter

1st Edition

1484207106, 9781484207109

More Books

Students also viewed these Databases questions

Question

What is meant by compensation for services? Give some examples.

Answered: 1 week ago

Question

Why does sin 2x + cos2x =1 ?

Answered: 1 week ago

Question

What are DNA and RNA and what is the difference between them?

Answered: 1 week ago

Question

Why do living creatures die? Can it be proved that they are reborn?

Answered: 1 week ago

Question

=+j Identify the challenges of training an international workforce.

Answered: 1 week ago