Explore BrainMass
Share

Writing JAVA Programming Scripts

This content was STOLEN from BrainMass.com - View the original, and get the already-completed solution here!

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

One must be created with the Graphics constructor.
It is an instance variable of the class JApplet.
It is a parameter of the paint method.

6. What can be stated about the line drawn by the following code? g.drawLine( 100, 200, 300, 200 )

the line is vertical.
The line is horizontal.
The line is a diagonal.
None the above.

8. What do the arguments 100, 200 represent in the following statement? g.drawRect( 10, 20, 100, 200)
The (x,y) coordinate of the upper-left corner of the rectangle we are drawing
The width and height of the rectangle we are drawing.
The height and width of the rectangle we are drawing.
The (x,y) coordinate of the lower-right corner of the rectangle we are drawing.

14. What is the (x,y) coordinate of the upper-right corner of the rectangle being drawn? g.fillRect( 10, 20, 250, 350 );

18. This code draws a filled rectangle with a width of 100 pixels and a height of 300 pixels, starting at the coordinate (50,30).
//assume you have a Graphics object called g
//your code goes here

20. This code draws a circle of radius 100 with its center located at (200,200).
//assume you have a Graphics object called g
//your code goes here

© BrainMass Inc. brainmass.com October 17, 2018, 11:54 am ad1c9bdddf
https://brainmass.com/computer-science/graphics/writing-java-programming-scripts-557561

Solution Summary

The expert determines how a programmer typically get access to a graphics object when coding an applet. JAVA programming scripts are provided.

$2.19
Similar Posting

Completing partially done java scripts that use an array.

In this lab, you complete a partially prewritten Java Program that uses an array. The program prompts the user to interactively enter 10 salaries, which the program stores in an array. It should then find the minimum and maximum salaries stored in the array, as well as the average of the 10 salaries. The data file provided for this lab includes the input statement and some variable declarations.

Please refer to attachment for full details. Trouble areas are highlighted.

View Full Posting Details