Problem Solving Assignment #1
Due Monday October 8th, 11:59pm
Required Skills: Chapter 2 and Chapter 3 up to page 70
Note that besides writing and turning in the code there is an interview process required fro this PSA worth 20% of your grade. (Details are at the bottom after the turn-in instructions.)
Please read this whole page before starting on your assignment. Ask a tutor, TA or instructor if you have any questions before you begin.
You will work with a partner on this PSA. Before you begin you must have a partner. Please review the guidelines for pair programming.
Note that besides writing and turning in the code there is an interview process required fro this PSA worth 20% of your grade. (Details are at the bottom after the turn-in instructions.)
Please read this whole page before starting on your assignment. Ask a tutor, TA or instructor if you have any questions before you begin.
You will work with a partner on this PSA. Before you begin you must have a partner. Please review the guidelines for pair programming.
Setup
Refer to lab 1 for instructions on how to log into and use one of the computers in the lab. This work should be done in its own folder. This folder should be called PSA1, and it should live in your home folder *not* on your desktop. Start by making a copy of the entire bookClasses folder into the PSA1 folder. (You will do this for each PSA -- make a new folder called PSAx using all upper case letters and start by copying the entire bookClasses folder into that folder.)
Problem
Write a program (in the Dr. Java definitions page) in a file called DrawMyName.java. Save this file in your PSA1/bookClasses folder. Do not save this in bookClasses on the Desktop! You must be working in the PSA1/bookClasses folder.
This program will use Turtles to draw your first name on the screen. To get started, copy and paste the sample code from the "Simple Code" section below. When you are done coding the assignment you program will do the following in the order listed:
Properly comment your code and place both partners' names, PIDs, emails, logins, and the date in the header. Also, you must place a history of each of your partners in the header (see below). (2pts)
You are required to create at least one turtle and to draw your name on the screen. However, feel free to be creative. You can use multiple turtles or have multiple colors if you want. (Hint: you can look through SimpleTurtle.java for interesting maneuvers the turtle can make).
Note: if your first name has more than 8 letters, you may just draw the first 8 letters.
You must name your files as indicated in the problem description for the turn in program to work. You must include both partner's names, logins, pids, emails and and the date in comments at the top of all for your files. In this case at the top of DrawMyName.java.
This program will use Turtles to draw your first name on the screen. To get started, copy and paste the sample code from the "Simple Code" section below. When you are done coding the assignment you program will do the following in the order listed:
- Create a World for your Turtle (1pt)
- Create a Turtle(s) in that World. (1pt)
- Draw one of your two first names on the screen using the Turtle(s). Your name should look similar to the example output, below, but you are encouraged to make it even more creative. (4pts)
Properly comment your code and place both partners' names, PIDs, emails, logins, and the date in the header. Also, you must place a history of each of your partners in the header (see below). (2pts)
You are required to create at least one turtle and to draw your name on the screen. However, feel free to be creative. You can use multiple turtles or have multiple colors if you want. (Hint: you can look through SimpleTurtle.java for interesting maneuvers the turtle can make).
Note: if your first name has more than 8 letters, you may just draw the first 8 letters.
You must name your files as indicated in the problem description for the turn in program to work. You must include both partner's names, logins, pids, emails and and the date in comments at the top of all for your files. In this case at the top of DrawMyName.java.
A note about partner histories
Your partner history list should include a list of each of your partners on the PSAs (not the labs), starting with your first partner (this PSA), and going through the current assignment (in this case, this PSA again). You should include your partner's first and last names and student ID numbers. For example, let's say Laura Grupp is submitting PSA3 and she is currently working with Shari Haynes as her partner. For PSAs 1 and 2 she worked with Vinay Venkatesh on both of them. Her partner list would look like:
Laura Grupp's partner history: PSA1 Vinay Venkatesh A0203484, PSA2 Vinay Venkatesh A0203484, PSA3 Shari Haynes A0393829
(Name are real, but ID numbers are made up for this example). She will then copy this partner history next week and add her PSA4 partner to the end of it and include it at the top of her PSA4 submission (along with her partner's history).
Laura Grupp's partner history: PSA1 Vinay Venkatesh A0203484, PSA2 Vinay Venkatesh A0203484, PSA3 Shari Haynes A0393829
(Name are real, but ID numbers are made up for this example). She will then copy this partner history next week and add her PSA4 partner to the end of it and include it at the top of her PSA4 submission (along with her partner's history).
Sample Code
/* Filename: DrawMyName.java
* Created by: Name - Login - PID - Email and Name - Login - PID - Email
* Partner history for Name1:
* Partner history for Name2:
* Date:
*/
public class DrawMyName
{
//The line below is magic, you don't have to understand it (yet)
public static void main (String[] args)
{
//Put all your commands to create a world, turtle and control the turtle here. (Remove this comment)
}
}
* Created by: Name - Login - PID - Email and Name - Login - PID - Email
* Partner history for Name1:
* Partner history for Name2:
* Date:
*/
public class DrawMyName
{
//The line below is magic, you don't have to understand it (yet)
public static void main (String[] args)
{
//Put all your commands to create a world, turtle and control the turtle here. (Remove this comment)
}
}
Example Output
Extra Credit, Extra Fun!
In addition to writing your name, use one or more turtles to draw a picture. (0.5pts)
Include a curve in your picture (0.5pts)
Include a curve in your picture (0.5pts)
How to Turn in Your Homework
Please turn in source listings for the entire program (including files that were provided for you) along with sample output to verify that your program works by running the turnin program:
turnin PSA1 /*if the current assignment is PSA1 */
If you've followed the instructions for naming your java file and placing it in the correct folder, simply open a terminal (Applications > System Tools > Terminal) and type the above command and press the enter key. The turnin script will compile your program and then run your code. Please don't wait to the last minute to run "turnin PSA1" for the first time. You can run "turnin PSA1" as many times as you want before the deadline, but you don't ever want to run "turnin PSA1" after the deadline. Doing so may clobber your on-time submission resulting in a score of 0.
After you have submitted your assignment, to verify what you have submitted, you can run the verify script:
verify PSA1 /* if the current assignment is PSA1 */
turnin PSA1 /*if the current assignment is PSA1 */
If you've followed the instructions for naming your java file and placing it in the correct folder, simply open a terminal (Applications > System Tools > Terminal) and type the above command and press the enter key. The turnin script will compile your program and then run your code. Please don't wait to the last minute to run "turnin PSA1" for the first time. You can run "turnin PSA1" as many times as you want before the deadline, but you don't ever want to run "turnin PSA1" after the deadline. Doing so may clobber your on-time submission resulting in a score of 0.
After you have submitted your assignment, to verify what you have submitted, you can run the verify script:
verify PSA1 /* if the current assignment is PSA1 */
Completing Your Interview (Individually this week)
20% (2pts) of your grade on this assignment will come from an interview you will have with one of the tutors during open lab hours. You have 48 weekday hours after the electronic turn in deadline to complete your interview. The deadline for the interview for PSA1 is Wednesday, October 10th (theoretically at midnight, but actually by the end of the last scheduled tutor hour).
You get an interview by going into the lab during a scheduled tutor hour. Find the tutor, ask them if you can interview for the 8A PSA. IF they have others who are waiting for interviews, your name will go on the end of the list of people waiting. Interviews take about 5 minutes each. It is your responsibility to go in early enough so that you can complete your interview. If everyone waits until the last hour on Wednesday, this will not work. If you go in on a Monday, people who need help with the assignment due that day will get preference over people who need interviews.
For the interview, you will need to have already submitted a signed copy of the integrity of scholarship form. The lab tutor will check to make sure you have done so before the interview. If you have not turned one in, you will be asked to download and print one and turn it in before you can complete the interview.
You will need to have a copy of your assignment stored in your account, so make sure you have one if you were not the partner who was logged in while you were programming. The tutor will ask you to log in, change to the directory where your work is and then to follow their directions. They will ask you to run your program to show that it works, open files in Dr. Java, and ask you questions about how your code works. Additionally, they may question you as to how you would theoretically make small changes to the program to have it do something slightly different. You will not actually be required to change your code.
Learning to be able to explain your problem solving process and discuss code with another human being is a very important professional skill. We hope that this process will help you develop this skill.
You get an interview by going into the lab during a scheduled tutor hour. Find the tutor, ask them if you can interview for the 8A PSA. IF they have others who are waiting for interviews, your name will go on the end of the list of people waiting. Interviews take about 5 minutes each. It is your responsibility to go in early enough so that you can complete your interview. If everyone waits until the last hour on Wednesday, this will not work. If you go in on a Monday, people who need help with the assignment due that day will get preference over people who need interviews.
For the interview, you will need to have already submitted a signed copy of the integrity of scholarship form. The lab tutor will check to make sure you have done so before the interview. If you have not turned one in, you will be asked to download and print one and turn it in before you can complete the interview.
You will need to have a copy of your assignment stored in your account, so make sure you have one if you were not the partner who was logged in while you were programming. The tutor will ask you to log in, change to the directory where your work is and then to follow their directions. They will ask you to run your program to show that it works, open files in Dr. Java, and ask you questions about how your code works. Additionally, they may question you as to how you would theoretically make small changes to the program to have it do something slightly different. You will not actually be required to change your code.
Learning to be able to explain your problem solving process and discuss code with another human being is a very important professional skill. We hope that this process will help you develop this skill.
Understanding Quiz
Preferably before you begin, but certainly before you submit your assignment, make sure you can answer each of these questions correctly. The answers are provided here. The answers can be found here.
Choose one answer for each question.
Question 1
To get started, you need to make a directory called PSA1 and put a copy of your book classes folder in that directory. After making the copy, should you put your new file in the original directory (bookClasses on your Desktop) or the copy (bookClasses in the PSA1 directory on your Desktop)?
Question 2
What should be the name of the new Java file you will create (feel free to use the template provided)?
Question 3
Assuming you followed the instructions and have put your files in the PSA1/bookClasses folder, when you submit your homework, you need to open a terminal then:
Question 4
If you have problems with the homework, you should:
Choose one answer for each question.
Question 1
To get started, you need to make a directory called PSA1 and put a copy of your book classes folder in that directory. After making the copy, should you put your new file in the original directory (bookClasses on your Desktop) or the copy (bookClasses in the PSA1 directory on your Desktop)?
- original -- bookClasses folder on the desktop
- copy -- bookClasses in the PSA1 folder
Question 2
What should be the name of the new Java file you will create (feel free to use the template provided)?
- DrawMyName.java
- drawName.java
- drawBob.java (if your name is Bob)
- drawMyName.java
Question 3
Assuming you followed the instructions and have put your files in the PSA1/bookClasses folder, when you submit your homework, you need to open a terminal then:
- type: turnin PSA1
- Follow directions as prompted.
Question 4
If you have problems with the homework, you should:
- Check the PSA1 question forum to see if your question has already been answered
- Check the forum guidelines and if appropriate, post your question
- Email the TA
- Email the Professor
- If your question doesn't meet forum guidelines (is personal or involved the code itself, for example) or you just want help faster, see the lab tutors
- Check the PSA tips
- 3 or 4
- 6 first, if not solved then 1, if not solved then possible 2 and/or 5