Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Specifications This program should be called AtTheBeach.java. For this program you are required to write 2 classes. The classes should be in the same file.

Specifications

This program should be called AtTheBeach.java. For this program you are required to write 2 classes. The classes should be in the same file.

Please follow the given naming guidelines. The expected output should be similar toimage text in transcribed

Define a class called BeachCanvas.

Define a public method called paint. This takes one argument of type Graphics and returns nothing. (5 points)

Set the color to a sandy brown. Suggested RGB value : 234 206 106. Define a polygon with the vertices at (0, 450), (0, 630), (630, 630) and (630,450). Draw this polygon. (10 points)

Set the color to sea green. Suggested RGB value : 32 178 170. Define a polygon with the vertices at (0, 300), (0, 450), (630, 450) and (630,300). Draw this polygon. (10 points)

Set the color to sky blue. Suggested RGB value : 0 191 255. Define a polygon with the vertices at (0, 0), (0, 300), (630, 300) and (630, 0). Draw this polygon. (10 points)

Set the color to yellow. Suggested RGB value : 255 255 0. Draw a circle that is confined to the rectangle beginning at (100,100) with a radius of 80. (10 points)

Set the color to red. Suggested RGB value : 255 0 0. Draw a filed arc section confined within the rectangle beginning at (400,400) which is 200 long and 125 high, from the angle 330 to the angle 190. (10 points)

Set the color to a very light gray. Suggested RGB value : 252 252 252. Define a polygon with the vertices at (540, 405), (449, 452) and (560, 485). Draw this polygon. (10 points)

Set the color to a dark brown. Suggested RGB value : 140, 45, 13. Define a polygon with the vertices at (497,466), (450,570), (460, 580) and (510, 470). Draw this polygon. (10 points)

-- You get 50 points extra credit for drawing a sailboat in the water. You just need to add three extra polygons in your paint method.

Define a class called AtTheBeach. Create a JFrame and set the bounds to 30 30 630 630. (5 points) Add an object of BeachCanvas to the frame and set to to be visible. (10 points)

Describe which part of the scene youre drawing with each geometric figure. Please include comments wherever appropriate. (10 points)

GENERIC GUIDELINES

For this program, you are restricted to using the JFrames, Graphics and Polygons classes. You can only use polygons and the basic geometric figures available under the Graphics class - rectangle, arc, oval, polygon and line.

Please make sure your code is readable and well documented.

Make sure to compile and run your program before you turn it in. Compilation errors can be costly.

You might want to use an IDE for this assignment, since getting GUI programs to compile on the command line is hard.

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

Database Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions

Question

4. What action should Cherita Howard take and why?

Answered: 1 week ago