Please navigate to the course Gradescope and complete the quiz “HW 0 Checkpoint, Collaboration, and Style Questions” to ensure that you fully understand our course policies. You will be able to see your results immediately and retake the quiz as many times as necessary. For aid in completing the quiz, you should use the tabs under the “Policies” dropdown on the course website, as well as our Style Guide.
The purpose of this assignment is to introduce you to coding in Java and familiarize you with the mechanics of preparing and submitting assignments. The specific goals are to:
If you find yourself needing help with this or any other assignment, please refer to our getting help page for the resources we have available.
The class discussion board is hosted on Ed. You should be automatically enrolled in the Ed course. Please contact one of the Head TAs if you are not.
Use Ed to:
We will be using Codio this semester - enroll in the Codio course by clicking the link at the course website.
Non-SEAS Students: Request your SEAS account here. It usually takes at least 30 minutes for your account to be activated. Even if you do not plan on using the lab computers, you should request an account now. If your own laptop stops working for any reason, you will be relieved to have immediate access to the lab computers. (Per SEAS policy, SEAS accounts are available only to registered students (including P/F), but not to auditors.)
This part of the homework walks you through completing your first program! Traditionally, the first program anyone writes in a new language just prints, “Hello, World!” to the interactions pane.
Once you’ve logged in to Codio, click Courses on the left and navigate to this class. Go to the “My Classroom” tab and select the assignment with the name “Hello, World!”
HelloWorld.java
file. You should update the name and PennKey at the top of the file. Type the following code, do not copy and paste it where you see the TO-DO comment, just for practice (it won’t take long). If you omit even a semicolon, the program won’t work.
As you type, Codio will do the indenting for you.
public static void main(String[] args) {
System.out.println("Hello, World!");
}
The cis110 jar file sets up tools to help you draw graphics and play sound (StdDraw and StdAudio) that are very simple to use. For CIS 1100, however, we will be using a drawing library that we have called PennDraw
. Before you make your own drawing, you will study our example drawing of a house to understand how the PennDraw
library works.
To do this part of your HW:
We have provided you with example code in MyHouse.java
to make sure that drawing is working on your computer. It also gives you some examples of what can be drawn using the PennDraw library. Read the PennDraw documentation to see what you can draw (i.e. shapes, images, text…) using PennDraw. The documentation page lists all of the functions you can use and explains how to use them.
Open the file MyHouse.java
in Codio. Ensure that the provided code compiles and runs on your computer. Pay attention to the comments in the code (the text that begins with “//” which appears in green) as they will help you understand what each line of code contributes to the drawing you see.
You will now write your own program which will create a drawing (like the one you saw in MyHouse.java
).
Find the file MySketch.java
in Codio. Use your HelloWorld and MyHouse programs to guide you in writing this new program. Design and create your own piece of digital art using Java and the PennDraw
library. Think of yourself as a creative designer when choosing the topic of your design.
This is your very first program, so here are some guidelines:
HelloWorld.java
.HelloWorld.java
and MyHouse.java
programs
public class [name of program]...
and have the statement public static void main(String[] args)
. This should remind you where you’ll need to put your drawing code.PennDraw.setCanvasSize()
, PennDraw.rectangle()
, PennDraw.filledRectangle()
etc.Here are some ideas to get you started:
Every assignment will have an accompanying readme
file that you will fill out and submit. This is a required part of the assignment and it usually takes only a few minutes. Among other things, the readme is where you can give any comments or feedback you have on the homework.
readme_hello.txt
on the left.readme_hello.txt
and save the file. You will submit it with everything else in the next step.For this homework, please submit the HW0 quiz on Gradescope in addition to the HW0 assignment.
All homework will be submitted to Gradescope. You should be already enrolled in Gradescope through Canvas. If you don’t know your login details, go to the Canvas course and click on Gradescope. This should prompt you to create an account linked to your Penn email and you’re all set up to submit. Complete the following steps to submit your HW0 assignment:
HelloWorld.java
, MySketch.java
, and readme_hello.txt
for submission, mark the assignment as completed on the Assignments page. Once you have marked the assignment as complete, you will be able to download the files by opening the project, right clicking on the file name and selecting Download. If you would like to continue working on the assignment, you will have to change the assignment back to In Progress.HelloWorld.java
, MySketch.java
, and readme_hello.txt
.HelloWorld (2.0/2.0)
with no other output then that is enough.)PennDraw.picture(0, 0, "cloud.png")
, you must include in your submission an image titled cloud.png
).