Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with a Java problem: Using the DrawShapes class provided below, write a class called DrawLogo that draws four filled shapes as seen

I need help with a Java problem:

Using the DrawShapes class provided below, write a class called DrawLogo that draws four filled shapes as seen in the image below. The shapes are positioned by specifying the location of their centers.

The magenta circle is centered at (0.25, 0.25).

The cyan circle is centered at (0.75, 0.75).

The red square is centered at (0.25, 0.75).

The blue square is centered at (0.75, 0.25).

The circles have radius 0.25, the squares are 0.25 by 0.25.

Here is a version of what your program should produce:

image text in transcribed

DrawShapes.java

import stdlib.*;

public class DrawShapes { public static void main(String[] args) { StdDraw.setPenColor(StdDraw.RED); StdDraw.setPenRadius(0.01); StdDraw.square(.5, .5, .5); StdDraw.setPenRadius(); StdDraw.setPenColor(StdDraw.CYAN); StdDraw.filledCircle(.7, .65, .25); StdDraw.setPenColor(StdDraw.BLUE); StdDraw.line(.5, .5, .9, .5); StdDraw.line(.9, .5, .5, .8); StdDraw.line(.5, .8, .5, .5); } }

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

Inductive Databases And Constraint Based Data Mining

Authors: Saso Dzeroski ,Bart Goethals ,Pance Panov

2010th Edition

1489982175, 978-1489982179

More Books

Students also viewed these Databases questions