Lab 1: Drawing

Download lab1.zip (by right-clicking on the link and choosing "save link as" to save this file to your desktop). Right-click on the "lab1.zip" icon on your desktop and choose to "extract here". You should see a folder named "lab1" appear. Now drag "lab1.zip" to the trash.

In DrJava, click to open a file, and navigate to the "lab1" folder you just created. Open the file "Lab1.java". Press the "Compile" button, and make sure the code compiles correctly.


  1. Insert code to draw the Target symbol shown below, in a drawing window. Once you've compiled your code successfully, test it by clicking on the "Run" button at the top of DrJava.


  2. Insert code to draw the simple traffic light shown below, in a drawing window.


  3. Insert code to create the following images:


  4. Insert code to draw a pentagon. Can you set up the 5 points so it draws a star instead?