You must disable your AdBlock software in your browser to use this site.
Disable ad blocking for practiceit.cs.washington.edu, then refresh this page to continue.
It is easy to disable AdBlock for just one site while leaving it enabled for other sites.
Just click the "stop sign" icon in the top-right of your browser, then un-check the "Enabled for this site" checkbox.
Thank you for your understanding and helping us to keep Practice-It free of cost for all students to use.
If you are still seeing this message after disabling your ad blocker, try clearing your browser history and refreshing the page.
Also make sure you don't have any other ad-blocking software running outside of your browser, such as a HOSTS file or proxy.
If you are certain that you are not running AdBlock or any other ad-blocking software, but you are still seeing this message,
please Contact Us.
Write a program in a class named Squares that uses the DrawingPanel to draw the following figure:
The drawing panel is 300 pixels wide by 200 pixels high. Its background is cyan. The horizontal and vertical lines are drawn in red and the diagonal line is drawn in black. The upper-left corner of the diagonal line is at (50,50). Successive horizontal and vertical lines are spaced 20 pixels apart.
(You don't need to include any import statements at the top of your program.)
(The next two exercises are modified versions of this program, so you can use the code you write here as a starting point for those exercises.)