CompSci 6- Classwork 3- Jan 21, 2010
10 pts
Today's classwork focuses on learning Eclipse and the APT.
You will work with a partner, but both of you will use a laptop and
solve all the problems. You should discuss problems with your partner and
help each other debug.
You will solve the following problems using Eclipse and the APT.
After getting them correct. You will submit them using the submit
program with Eclipse.
- 1-Heap Nim (you do not have to submit this one)
- HingedDoor
- DivToZero
Using Eclipse and the APT
- Start Eclipse. NOTE THE PATH! When Eclipse starts it asks
you the path where you
want to store your CompSci 6 files. You can change this, but remember what
this path is.
- Create a new project for your work today. In the top right corner of
Eclipse, select "File", then "New", then "Java Project".
Name the project "Class03-Jan21". Then Select "Finish" You will put all your
classwork from today in there.
The window should look like:
- If you get the message that your Java Compiler Compliance is less than 1.6, you should
click there and update it to select 1.6.
- You will put all three of these Java APT problems in this project.
Now add a class file to the project. Add a class file called
OneHeapNim by doing the following. First click on the project Class03-Jan21
that you just added. It should be highlighted like this:
Select "File", then "New", then "Class". The sourcefolder should
be Class03-Jan21. For "name", enter in "OneHeapNim" (note no blanks and the case
of each letter).
If "public static void main..." is selected, unselect it.
Then click "Finish".
Enter your Java code.
Running the APT
When your Java code is ready for testing, load up the CompSci 6 web page.
If you haven't connected to the wireless network, then you will need to do that
first. Click on the computer icon on the lower right of the screen for
wireless network and select "Duke" network.
Load the APT web page from the CompSci 6 web page.
Select the OneHeapNim problem and load the .java file you wrote.
You will need to browse to the workspace location path Eclipse setup
when you logged into Eclipse.
Click on Test/Run. If you get all green lights
that is great! If not, debug and continue until you get green lights.
Repeat for the HingedDoor and DivToZero problems.
You can create classes for them in the same Project.
If you don't finish these in class, then finish them before the next class.
Don't submit them until you have all three of them completed.
Submitting your files with Ambient
Once all three programs are ready to submit. You need to do the following.
- Make sure each program you write has a comment with both your name
and the date.
Although you are working beside a partner, both of you are typing and
submitting your own code.
- Create a simple text file called README or README.txt
("File", "New", "File")
in the same project that has the following info
- Name: your name
- Partner: your partner's name
- Date: the date
- Any comments on the programs, Eclipse or the APT.
- Approximately how long you worked on all three of these problems.
- The names of anyone you received help from outside of class on
these problems (for example, another student, UTA, graduate TA, or
Professor). If you got help during class you do not need to list those names.
- In Eclipse, select "Ambient", "Submit a Project for Grading".
- Click on the "+" beside cps006 and you should see "Class03-Jan21".
Click on Class03-Jan21 to highlight it.
- If the workspace path is not correct, browse to it.
- Find your folder Class03-Jan21 and click on the box beside it to select it.
Then click "Submit" at the bottom. You will be prompted for you Duke netID
and password.
You should receive a message that it was successful.
- You can check which files where submitted by clicking on "Ambient"
again, and selecting "Submit History". Click on "Class03-Jan211" and
"Get History". Again you will need to type your Duke NetID and password.
It should show you the files you submitted.
- If you realize you forgot to submit a file, or you wanted to fix
your program, you can resubmit. If you do, resubmit all files again. We
will only grade the last submission. If you need to submit something by
a certain date and you resubmit after that date, then your program is
considered late.