subject

Objectives: Instantiating objects, sending messages, and managing multiple files
Continued practice with loops and decomposition
For this assignment you'll be using the DrawingPanel. java class provided with the textbook. You will need to have this file in the same BlueJ folder as your solution.

There are two parts to this assignment:

Part 1: For the first part, you are going to write the code to draw any figure you'd like on the DrawingPanel. For full credit, your image must meet the following requirements:

at least 200 x 200 units
contains at least three different draw and/or fill messages to the Graphics object (using at least two different shapes)
uses at least two distinct colors
and is not similar to the image for Part 2.
You must also display your name on the DrawingPanel, using the method that writes a String to the Graphics object.

Put the complete solution for part 1 in its own method definition and call this method from main(). You may decompose this solution into multiple methods, but it is not a requirement.

Part 2: In the second part of the assignment your program must produce the image below containing several images of illusions.
note: the image is attached below.

This image has a structure. You see two individual circular illusions, we'll refer to them as discs, of different sizes and colors in different locations. There are also rectangular grids that contain rows of discs. Your solution should include methods to mimic this structure.

The 5 drawings on your DrawingPanel should have the following properties:
note: picture for properties description is attached below.

For the grids, the center point specified is the center of the upper-left disc.

The overall panel has dimensions 850 x 850 with a gray background.

Implementation Requirements:
The disc shape has the following properties:
Each disc is made up of 8 rings, including the circumference, with the radii getting smaller by an equal amount with each step.
The straight lines are drawn from top center, to left center, to bottom center, to right center.
Your method design should use parameters wisely so it can be used to draw one disc of any size, any color, in any location. If you'd like, consider using the Point class from the Java API (though this isn't a requirement).
The grid is made up of a series of pairs of rows, where every other row is indented by a fixed amount (you should be able to determine this amount from the image). The number of pairs equals the number of discs per row.

Each grid is a square; the number of discs in a row indicates the number of row pairs.
Your method design should use parameters wisely so it can be used to draw one grid of any size, any color, in any location. Do not make your method more flexible than this. In otherwords, the parameters should be the minimum needed to draw the specific design.

NOTE: feel free to choose your own background color and color for the images.

Since we will need access to the Graphics object's methods and the Color constants, you need to include an import statement for its package. Include the following import statement at the beginning of your class file:

import java. awt.*;

Put the complete solution for part 2 in its own method definition. This part2() method should contain the method calls to draw the entire image. Call this method from main(). The main method should only contain 2 methods calls.

When you are finished with both parts and you call main, 2 DrawingPanels should be displayed (don't worry if they open on top of one another).

Other Requirements:
Make good decomposition choices.
You are expected to use good style (indentation, commenting, good variable names, etc) and to include a block comment for the class and for each method. Please see the documentation guidelines posted on our website.
You do not need to create class constants for the values used to call your methods. However, there is a value here that should be a defined as a constant.
Use algorithm comments effectively.
For this assignment you are limited to the language features in Chapters 1 through 3G of the textbook. In particular, you may not use if statements.
Make sure to document each of your methods (except main()) with the information discussed previously:
description of the method's job or outcome
description of every parameter
return (if there is any)


Objectives:

Instantiating objects, sending messages, and managing multiple files
Continued practi
Objectives:

Instantiating objects, sending messages, and managing multiple files
Continued practi

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 04:30
Dr. wisteria is a prominent chiropractor in the chicago area. she wants to provide a forum for her patients to discuss their health concerns and to seek and offer advice to other patients. which telecommunications tool is most appropriate for dr. wisteria's needs?
Answers: 3
question
Computers and Technology, 23.06.2019 01:20
Write a function balancechemical to balance chemical reactions by solving a linear set of equations. the inputs arguments are: reagents: symbols of reagents in string row array products: symbols of products in string row array elements: elements in the reaction in string row array elcmpreag: elemental composition of reactants in two dimensional numeric array elcmpprdcts: elemental composition of prducts in two dimensional numeric array hint: the first part of the problem is setting up the set of linear equations that should be solve. the second part of the problem is to find the integers from the solution. one way to do this is to mulitiply the rational basis for the nullspace by increasing larger integers until both the left-and right-side integers exist. for example, for the reaction that involves reacting with to produce and : reagents=["ch4", "o2"]; products =["co2", "h2o"]; elements =["c","h", "o"] elcmpreag=[1,4,0;
Answers: 3
question
Computers and Technology, 24.06.2019 02:00
What is a loop? a. a collection of function definitions at the top of a program b. a line of code that defines a variable and assigns it a value c. a program that opens the turtle graphics window d. a block of code that repeats a specific number of times
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
What is the process in which the software development team compiles information to determine the final product
Answers: 1
You know the right answer?
Objectives: Instantiating objects, sending messages, and managing multiple files
Continued pr...
Questions
question
Mathematics, 20.04.2020 21:01
question
Mathematics, 20.04.2020 21:02
Questions on the website: 13722362