fgets to read the restaurant name (-2)
EOF to mark the end of the file (-4)
numTables correctly
numTables variable (-5, -6, -7)
for loop for the T option (-1)for loop.
sum = 0 should be before the loop (-1)main:
computeScheduleAndPrint:
int main(int argc, char *argv[])
{
if (argc == 1)
{
printf("No arguments\n");
}
{
printf("Here");
}
return 0;
}
if, else, while, function declarations, etc.
fscanf string messed up program (-3)
while (altitude, easting, northing != SENTINEL) (-2)altitude, easting, and northing != SENTINEL in turn and returns the value returned by northing != SENTINEL
if (...)
printf("File doesn't exist\n");
else
printf("Easternmost point: ...");
printf("Westernmost point: ...");
printf("Northernmost point: ...");
This code is incorrect. It will execute the two printf statements at the bottom regardless of whether the if is taken or not. It should be:
if (...)
printf("File doesn't exist\n");
else
{
printf("Easternmost point: ...");
printf("Westernmost point: ...");
printf("Northernmost point: ...");
}
#define for the sentinel value (-1)
if (count == 0) ... (-2)pwd, cat DISTANCE.DAT, and rm DISTANCE.OUT (-5)
if statement (-6)if statements, your program will give a segmentation fault if the files can't be opened. A reason that DISTANCE.DAT would fail to open is if it doesn't exist. A reason for DISTANCE.OUT to not open is if you don't have write permissions on the file.
if statements, but used the files before checking (-3)
int instead of a float or double (-2)