Project 3: Card suits and numbers
Nov. 21, 2009
When we created Card class, we used the following numbering scheme for suits:
0 = clubs, 1 = diamonds, 2 = hearts, 3 = spades
When we created Card class, we used the following numbering scheme for suits:
0 = clubs, 1 = diamonds, 2 = hearts, 3 = spades
Class evaluations will begin November 19th at 8am and remain open until December 9th at 8am, when final exams begin. The ClassEval website is https://classeval.ncsu.edu/. You will also be receiving another email from the university reminding you about ClassEval.
Dr. Perry & James
Dr. Perry will be away from email for an unknown amount of time. If you have any questions please email me, or both of us, it is the fastest way to get a reply.
Test 2 status: Dr. Perry has your tests with her. I will try to catch her or her husband to get the test for grading.
Project 3 status: This project is a joint effort with the on-campus instructor. It appears it will be ready shortly. I can't tell if that means 1 day or 1 week though. I will try to find out for everyone.
Some of you have complained about getting a Null Pointer Exception when trying to set a color on a "brush," like this:
Graphics brush = pnlSimulation.getGraphics();
brush.setColor(Color.BLUE);
That second statement will generate an error if you attempted to execute it before pnlSimulation is displayable. To correct the error, make sure that:
Test 2 will be given on campus in EB2 Room 1228 on Wednesday, November 4 at 6 pm. You will be allowed 75 minutes to complete the test. If you are taking the test off campus, you should arrange a time to take it next week with your proctor.
The test will cover all the material mentioned in the schedule through the week of October 19 21. The test format is similar to the previous test with fill in the blanks, short answer, short coding, and some method definitions. The approximate question breakdown is:
I have posted project 1 grades. You can find your grades in the gradebook. I have also uploaded a text version of the gradesheet. A link labeled 'Retrieve Assignment' will appears on http://courses.ncsu.edu/csc216/, or you can use submit.ncsu.edu.
When you run a simulation, make sure that you do the task in each step in the correct order. This is the logic that I used:
for each step of the simulation
get the count for predator, prey, scavenger
plot all of the counts on the graph
get the projected population for predator
get the projected population for prey
get the projected population for scavenger
set the predator count with the value just retrived (from the projected population)
set the prey count with the value just retrieved
set the scavenger count with the value just retrieved
It is important to get each projected population before setting any count. Make sure you understand why.
In the original version of Project 2, the population growth factors for the scavenger were incorrectly listed in the table that was part of the simulation requirements. That has been fixed in the current version. Make sure that your equation for calculating changes in scavenger populations is correct. So, using x for prey, y for predator, and z for scavenger counts, the growth factors should be treated so:
The Animal class declares two abstract methods: registerPredator() and registerPrey(). Here is why.
Each Animal in the simulation ecosystem must be associated with a concrete Predator or Prey. But when you create an instance of Predator, no instance of Prey may yet exist. At some time, you have to decide which species (which instance) is is going to be the prey for the instance of Predator you just created. So suppose you create coyote as an instance of Predator and later create mouse as an instance of Prey. Then this statement determines that mouse is prey for the coyote:
coyote.registerPrey(mouse);
Similarly, you want to do this for mouse:
mouse.registerPredator(coyote);
registerPredator() registerPrey() are setter methods with the prefix "register" instead of "set."
I have posted Project 2 and linked it to the schedule and the project page. This project requires that you:
If you took the test with Dr. Perry and myself your grades have been posted in Gradebook. I have not received any remote test as of yet. Once I receive all tests I will turn them over to the DE department to be scanned and email your graded test back to you.
A link to the Gradebook will appear here http://courses.ncsu.edu/csc216/
Your first test is next week. Those taking the test with a proctor can take the test any time from Monday through Friday afternoon. Those taking the test on campus should come to EB2 Room 1228 on Wednesday. Sept 30 at 6 pm. You will be allowed 75 minutes to complete the test.
The test will cover all the material mentioned in the schedule through the week Sept 21, 23. (There will be no questions on Composition, however.) The question format includes fill in the blanks, short answer, and short coding. The approximate breakdown for questions is:
Some students in the class have edition 3 of the textbook while others have edition 2. The chapter listings on the schedule page are all in reference to edition 2. If you have edition 3, you can translate to the corresponding reading material from edition 2 through a website that the author provides: http://www.horstmann.com/bigj2/ConversionGuide.html