Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Project 2: Draw Curves from Straight Lines 1 Objective In this program, you will get in introduction to using objects; we will not create our
Project 2: Draw Curves from Straight Lines 1 Objective In this program, you will get in introduction to using objects; we will not create our own just yet. You will also learn about and use typical graphics coordinate systems. 2 Input & Output This program gathers no input from the user. 2.1 Part 1 Generate the graphic output shown at right, on a 600x600 DrawingPanel. Use a black background. Alter the line color to suit your taste. Set the increment between lines to something pleasing to the eye; it does not need to match the sample. For descriptions of the technique and samples of output, see these sites: site1, site2. 2.2 Part 2 3.1 What You May Use Constants and variables; use the requested naming convention and declare them at the appropriate scope (i.e., use no global variables unless unavoidable, but global constants where they make sense). Definite loops. Drawing panel and graphics objects. Math methods like Math.round, plus trigonometry methods like Math.cos if you would like. 3.2 What You May Not Use Selection control structures (unless you are doing something special for Part 2). That means no if statements, switch statements, or ternary operators. 4 Extra Credit Instead of using a single color, draw a figure like the one shown at right. The line colors should shift gradually from one color to different color. In the sample, the lines shift from blue to green. Add global constants for starting color and ending color; these should work properly with any colors I may specify. 5 Submitting Your Work Submit your .java file; there is no need to submit the Drawing Panel.java code. 6 Hints Look over the supplied sample code that uses the DrawingPanel. Having a link to the online Java API reference will come in handy now and in the future. It is also linked from inside your Blue) UI. Do not duplicate code if you can avoid doing so; this is a good rule of thumb, now and always. To watch the figure being drawn, include a Drawing Panel sleep method call in the appropriate spot
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