Ok, I’m about to submit some more CS homework, and it’s a remake of what I lost two points for in my homework a couple of weeks ago. I’m standing by my points from then and I don’t care if I lose 2 points, because at least I’ll know I was right. I did add some comments to my source though, and I’ve included them below.
/***************************************************************************
// Each is to compare two times of day, and return 1 if true and 0 if false.
***************************************************************************/
int isAfter(const tod* t1, const tod* t2) // true if 1st is after 2nd
{
if(diffTod(t1, t2) > 0) {
return 1;
} else if(diffTod(t1, t2) <= 0) {
return 0;
}
}
int isBefore(const tod* t1, const tod* t2) // true if 1st is before 2nd
{
if(diffTod(t1, t2) < 0) {
return 1;
} else if(diffTod(t1, t2) >= 0) {
return 0;
}
}
/*
If I’m supposed to “return 1 if true and 0 if false”
AND
the function comments on lab6 say “true if 1st is [before/after] 2nd”
Then the only correct way to handle two times being the same is to return 0.
It would be easy enough to create an isEqual function which checks for equality
but that’s not what I was supposed to do, and so I have followed your instructions
completely correctly, as I did in lab6 when you deducted 2 points from my score.
*/
If he deducts more points I’m going to complain to the head of Computer Science, who taught me last semester. He’s being an ass about this, and he’s wrong. Continue reading →
Copy and paste this URL into your WordPress site to embed
Copy and paste this code into your site to embed