Amanda M James: Portfolio

Language of the code What the sample is supposed to do Sample of code
Java on Greenfoot Compiler This code was to make a frog object, that was an obstacle in a maze program /**
* Change the direction of the frog
*/
public void changeDirection()
{
if (getDirection()== "down")
{
setRotation(-90);
direction = "up";
}
else
{
setRotation(90);
direction = "down";
}
}
C++ for AutoHotKey This code starts up the eclipse compiler that I use to compile code I write or edit for class ; CRTL+SHIFT+p starts eclipse
^+e::
KeyWait, CTRL
Keywait, SHIFT
Keywait, e
Run, C:\Users\User\Downloads\eclipse-SDK-4.2-win32\eclipse\eclipse.exe
return
Java on Eclipse Compiler Returns the highest grade of the test results that have been added to this Gradebook, or 0 if none have been added. public int highestGrade() {
if (this.size() == 0) {
return 0;
}
int highestGradeSoFar = Integer.MIN_VALUE;
for (TestResult aResult: this.results) {
if (aResult.getGrade() > highestGradeSoFar) {
highestGradeSoFar = aResult.getGrade();
this.results.add(highestGradeSoFar, [0]);
}
}
return highestGradeSoFar;
}
Amanda M James
P.O. Box 11493
Carrollton, GA 30117
770-584-6097