Problem Solving Assignment #1
Turnin due Monday January 14th, 11:59pm
Interview due Thursday January 18th, 12:00pm
Please read the whole page before starting. Ask a tutor, TA or instructor if you have any questions before you begin.
Required Skills: Chapter 2 and Chapter 3 up to page 70.
Note that besides writing and turning in the code there is an interview required by both students for this and every PSA worth 20% of each assignment grade.
You will work with a partner on this PSA. Before you begin you must have a partner. Please review the guidelines for pair programming.
Required Skills: Chapter 2 and Chapter 3 up to page 70.
Note that besides writing and turning in the code there is an interview required by both students for this and every PSA worth 20% of each assignment grade.
You will work with a partner on this PSA. Before you begin you must have a partner. Please review the guidelines for pair programming.
How to Get Started
- Look up your course account at https://sdacs.ucsd.edu/~icc/index.php (your account will start with cs8w)
- If your computer is booted on Windows, restart the computer and login to the machine in CentOs (this is Linux).
Set up Dr.Java
1) Open Dr.Java by double clicking on the Dr.Java icon on your desktop using the left mouse button.
2) Click on Edit.
1) Open Dr.Java by double clicking on the Dr.Java icon on your desktop using the left mouse button.
2) Click on Edit.
3) Select 'Preferences' from the 'Edit' dropdown.
4) From the 'Preferences' window, click on the Add button next to 'Extra Classpath'.
5) Double-click the 'Public' folder.
6) Double-click the 'cs8w-public-folder' folder.
7) Click the 'bookClasses' folder.
8) Click 'Select'.
9) Click on 'Ok' to exit out of 'Preferences'.
Set up Assignment folder
1) Right-click in an open space on the Desktop and select 'Open in Terminal' from the drop down menu.
(it will bring up the following window)
9) Click on 'Ok' to exit out of 'Preferences'.
Set up Assignment folder
1) Right-click in an open space on the Desktop and select 'Open in Terminal' from the drop down menu.
(it will bring up the following window)
2) Highlight the following 7 lines with the mouse, right-click to copy:
cd ../public/PSA1
make directories
make install
cd
cd PSA1
mv DrawMyName.java.empty DrawMyName.java
ls
3) Select the terminal window with the mouse and right-click to paste.
4) Verify that the 'DrawMyName.java' file is shown as the result of the last command.
Following these procedures, your file will be named correctly and be located in the correct places. For every assignment you need to follow correct naming
assignments in the correct locations to get credit for your work.
5) Proceed to start your programming assignment.
cd ../public/PSA1
make directories
make install
cd
cd PSA1
mv DrawMyName.java.empty DrawMyName.java
ls
3) Select the terminal window with the mouse and right-click to paste.
4) Verify that the 'DrawMyName.java' file is shown as the result of the last command.
Following these procedures, your file will be named correctly and be located in the correct places. For every assignment you need to follow correct naming
assignments in the correct locations to get credit for your work.
5) Proceed to start your programming assignment.
Problem
When you are done coding the assignment your program will do the following in the order listed:
4. Properly comment your code and place both partners' names, logins, and the date in the header. Also, you must place a history of each of
your partners in the header (see below). (2pts)
5. Verify that both you and your partner each have a copy of the code.
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.
- 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)
4. Properly comment your code and place both partners' names, logins, and the date in the header. Also, you must place a history of each of
your partners in the header (see below). (2pts)
5. Verify that both you and your partner each have a copy of the code.
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.
A note about partner histories
Your partner history is a list of each of your partners for each PSA (not the labs), starting with your first partner (this PSA), and going through the current assignment (in this case, this PSA again). You will include your partner's first and last names and their cs8w login name. For example, let's say Alberto Garcia is submitting PSA1 and he is currently working with Shari Haynes as his partner. For PSA1 his partner list would look like the following example given in the 'Sample Code' section. Note that you may have the same partner, at most twice.
Sample Code
/* Filename: DrawMyName.java
* Created by: Shari Haynes, cs8w2 and Alberto Garcia, cs8w4
* Due Date: January 14, 2013
*
* Partner Histories:
* Shari Haynes:
PSA1 Partner: Alberto Garcia, cs8w4
PSA2 Partner: To be determined...
PSA3 Partner: To be determined...
PSA4 Partner: To be determined...
PSA5 Partner: To be determined...
PSA6 Partner: To be determined...
PSA7 Partner: To be determined...
PSA8 Partner: To be determined...
PSA9 Partner: To be determined...
* Alberto Garcia:
PSA1 Partner: Shari Haynes, cs8w2
PSA2 Partner: To be determined...
PSA3 Partner: To be determined...
PSA4 Partner: To be determined...
PSA5 Partner: To be determined...
PSA6 Partner: To be determined...
PSA7 Partner: To be determined...
PSA8 Partner: To be determined...
PSA9 Partner: To be determined...
*/
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: Shari Haynes, cs8w2 and Alberto Garcia, cs8w4
* Due Date: January 14, 2013
*
* Partner Histories:
* Shari Haynes:
PSA1 Partner: Alberto Garcia, cs8w4
PSA2 Partner: To be determined...
PSA3 Partner: To be determined...
PSA4 Partner: To be determined...
PSA5 Partner: To be determined...
PSA6 Partner: To be determined...
PSA7 Partner: To be determined...
PSA8 Partner: To be determined...
PSA9 Partner: To be determined...
* Alberto Garcia:
PSA1 Partner: Shari Haynes, cs8w2
PSA2 Partner: To be determined...
PSA3 Partner: To be determined...
PSA4 Partner: To be determined...
PSA5 Partner: To be determined...
PSA6 Partner: To be determined...
PSA7 Partner: To be determined...
PSA8 Partner: To be determined...
PSA9 Partner: To be determined...
*/
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
How to Turn in Your Homework
1) Open the terminal
2) cd PSA1
3) autograder login -e yourucsdemailhere -p (wait for password prompt)
4) type in your password
5) turnin PSA1
2) cd PSA1
3) autograder login -e yourucsdemailhere -p (wait for password prompt)
4) type in your password
5) turnin PSA1
Completing Your Interview
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 until noon on Thursday for assignments due Monday and noon on Friday for assignments due Tuesday to complete your interview. The deadline for the interview for PSA1 is Thursday January 17th at noon.
You get an interview by going into the lab during a scheduled tutor hour. Find the tutor, ask him or her if you can interview for the 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 the last day, then 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.
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 him or her if you can interview for the 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 the last day, then 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.
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 can be found here.
Choose one answer for each question.
Question 1
What should be the name of the new Java file you will create (feel free to use the template provided)?
Question 2
If you have problems with the homework, you should:
Choose one answer for each question.
Question 1
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 2
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