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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 20:00, jroy1973
Awide variety of “ apps “ are available to customize devices. which category of app does the word processing software fall into?
Answers: 2
image
Computers and Technology, 23.06.2019 01:00, Ltik11900
Write the command that can be used to answer the following questions. (hint: try each out on the system to check your results.) a. find all files on the system that have the word test" as part of their filename. b. search the path variable for the pathname to the awk command. c. find all files in the /usr directory and subdirectories that are larger than 50 kilobytes in size. d. find all files in the /usr directory and subdirectories that are less than 70 kilobytes in size. e. find all files in the / directory and subdirectories that are symbolic links. f. find all files in the /var directory and subdirectories that were accessed less than 60 minutes ago. g. find all files in the /var directory and subdirectories that were accessed less than six days ago. h. find all files in the /home directory and subdirectories that are empty. i. find all files in the /etc directory and subdirectories that are owned by the group bin."
Answers: 1
image
Computers and Technology, 23.06.2019 03:30, bellsbella34
Ihave a singular monitor that is a tv for my computer. recently, i took apart my computer and put it back together. when i put in the hdmi cord and booted the computer to see if it worked, the computer turned on fine but the screen was blue with "hdmi no signal." i've tried everything that doesn't require buying spare parts, any answer is appreciated!
Answers: 1
image
Computers and Technology, 23.06.2019 10:00, karissanichole18
Install and use wireshark program ( send back screen shots and other vital information) case project 3-2: decode a tcp segment in a wireshark capture in this chapter, you walked through tcp segment to interpret the data included in its header. in this project, you use wireshark to capture your own http messafes, examine the tcp headers, and practice interpreting the data you'll find there. 1. open wireshark and snap the window to one side of your screen. open a browser and snap that window to the other side of your screen so you can see both windows.
Answers: 2
You know the right answer?
Objectives: Instantiating objects, sending messages, and managing multiple files
Continued pr...

Questions in other subjects:

Konu
Mathematics, 04.12.2020 20:00
Konu
English, 04.12.2020 20:00
Konu
Biology, 04.12.2020 20:00