In this exercise, you will create a shapes package that will use the concepts of inheritance,
abstract classes and polymorphism.
Activity: Create a program that when given a string value describing the color and the
shape draws an outline of the shape on the screen. For example, when you type “green
circle” the program draws a green circle outline on the screen and when you type “blue
rectangle it draws an outline of a blue rectangle on the screen.
This shape outline should take up at least three quarters of the screen and be centered
in the middle of the screen. When you move your mouse within the boundaries of the
shape, your program should fill the shape to the color specified, so if you have a “blue”
rectangle outline, when you move your mouse course over the shape should be filled
“blue”. If you drag your mouse over the shape it should write out the color and type of
shape to the screen with its attributes. For example, if you drag your cursor over a “red”
circle outline, it should write “Red Circle” legibly on the screen, along with its center
location, and either its radius or width, and height in pixel lengths. See Interface Lecture
videos for some insight on how to use the ControlPanel and Viewer files.
Update your program to do the following:
Task Check List
r Create a Shape class that stores the color, center X and Y coordinates of a shape
as well as the upper left X and Y locations of the shape. The shape should have the
ability to draw a graphics object and write out the center X and Y locations of the
shape. Design your constructors to meet the needs of the problem.
r Create a Circle class that stores its radius (pixel units) and prints out the radius along
with the center X and Y locations from the Shape class. You should be able to call a
“draw” method on this shape class. Design your constructors to meet the needs of
the information given above. See Interface Lecture videos for some insight.
r Create a Rectangle class that stores its width and height (pixel units) and prints out
the width and height along with the center X and Y locations from the Shape class.
You should be able to call a “draw” method on this shape class. Design your
constructors to meet the needs of the information given above. See Interface Lecture
videos for some insight.

Found something interesting ?

• On-time delivery guarantee
• PhD-level professional writers
• Free Plagiarism Report

• 100% money-back guarantee
• Absolute Privacy & Confidentiality
• High Quality custom-written papers

Related Model Questions

Feel free to peruse our college and university model questions. If any our our assignment tasks interests you, click to place your order. Every paper is written by our professional essay writers from scratch to avoid plagiarism. We guarantee highest quality of work besides delivering your paper on time.

Grab your Discount!

25% Coupon Code: SAVE25
get 25% !!