University of Iowa Computer Science Department

Quiz 01

 

1. Declare three integer variables named length, width, and area. Assign 10 to the length variable, 27 to the width variable, and then assign the area of a rectangle of this length and width to the area variable using an expression.

2. You have placed a picture box (named pictureBox1) and a button on a form. When you click the button, the event handler for that button is invoked. Write the commands to create a graphics object (from pictureBox1), create a Pen (with red ink), and draw (using the pen) a rectangle of width 10, height 20, starting at location 10, 30 in the picture box.

UI CLAS CRA ACM Valid CSS! Valid XHTML 1.0 Transitional Level Double-A conformance icon, W3C-WAI Web Content Accessibility Guidelines 1.0 Cynthia tested
| Modified: January 27, 2006, 08:15:22.