Programming in Java

timer Asked: Nov 22nd, 2013

Question description

Programming in Java

Week 2: Chapter Exercises

Chapter 4: Even Only 

How does a programmer typically get access to a Graphics object when coding an applet?

In an applet, the paint method is called automatically even if the programmer does not code the method call.

What can be stated about the line drawn by the following code?

g.drawLine (100,200,300,200)

What do the arguments 100,200 represent in the following statement?

g.drawRect (10, 20,100,200)

In RGB format, gray color can be coded as A A A where the first A represents the amount of red in the color, the second A the amount of green, and the third A the amount of blue. A can vary from 0 to 255, including both 0 to 255; how many possible gray colors can we have?

What is the length of the line being drawn?

g.drawLine (50, 20, 50,350)

What is the (x, y) coordinate of the upper-right corner of the rectangle being drawn?

g.fillRect (10, 20,250,350)

This code sets the current color to red.

This code draws a filled rectangle with a width of 100 pixels and a height of 300 pixels, starting at the coordinate (50, 30).

This code draws a circle of radius 100 with its center located at (200,200).

Tutor Answer

(Top Tutor) Studypool Tutor
School: UC Berkeley
Studypool has helped 1,244,100 students
flag Report DMCA
Similar Questions
Hot Questions
Related Tags

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors