Question
Java Program This question is answered by using DrawingPanel.java class. Input This program gathers no input from the user. 1. Output 3.1 Part 1 Generate
Java Program
This question is answered by using DrawingPanel.java class.
Input
This program gathers no input from the user.
1. Output
3.1 Part 1
Generate this graphic output shown at right, on a 500x500 DrawingPanel.
Alter the colors (drawing and background) to suit your own taste.
For descriptions of the technique and samples of output, see these sites: site1, site2.
3.2 Part 2
Create an additional drawing panel at least 400 x 400. On it, draw filled-in shapes of at least two types (rectangles, circles, etc.) in at least two colors.
Each shape type should be drawn by its own function (that you write) with parameters indicating where it is to be drawn and how big it is to be. Consider including the color as a parameter as well; this would make the function more flexible.
Draw at least ten shapes in an attractive pattern; do something fun and interesting of your own design.
2. Instructions
Use the provided DrawingPanel.java class. Put this in the same folder as your solution.
Use procedural decomposition to break down the program into logical pieces.
Part 1: set constants for the drawing panel size and the line increment. Assume your figures may drawing on different sizes of the canvas.
Part 1: try various line increments until you find one that is visually pleasing and looks curved.
Use a Random object for creating different colors.
3. Code Implementation
Create a class called HW2Drawing; use this single class to do all your work. You should have only one main function that directs both parts of the project. Follow the provided Course Style Guide.
5.1 What You Should Use
Constants and variables
Definite loops (For Part 1, a single loop should be used to draw the entire figure)
Drawing panel and graphics objects
A single main program that draws both drawings (Part 1 and Part 2)
5.2 What You Shouldnt Use
Selection control structures, unless you are doing something way above and beyond the specification.
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