I fucked up my big test in my Computer Science class the other day. It was a series of static methods and method calls and one of the methods was declaring an object in the parameter and I had like 5 minutes left so I panicked and wrote this down in the body:
Code:
public static double distance(Point a){
double result = Math.sqrt(Math.POW((coord1.getPointX - a),2)+Math.POW((coord1.getPointY - a), 2));
return result;
}
When I should have done:
Code:
public static double distance(Point a){
double result = Math.sqrt(Math.POW((coord1.getPointX - a.getPointX),2)+Math.POW((coord1.getPointY - a.getPointY), 2));
return result;
}
I panicked and didn;t have enough room and there was no time... UGH. It was a super important part of the test, too... DAMN.