Question
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:
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started