&sectionHeader('Straightforward cases (50 points)');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('001', 'Declaration');
$subtotal += &runTest('002', 'Two declarations');
$subtotal += &runTest('003', 'Empty function');
$subtotal += &runTest('004', 'Non-empty function');
$subtotal += &runTest('005', 'Mixed functions, declarations, statements');
$subtotal += &runTest('006', 'Poor formatting');
$subtotal = $subtotal * 50 / 6;
$total += floor($subtotal);
&sectionResults('Straightforward cases (50 points)', $subtotal, 6, $checkpoint );
$testCount += 6;

&sectionHeader('Comments (20 points)');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('007', 'Semi-colons in C comments');
$subtotal += &runTest('008', 'Semi-colons in C++ comments');
$subtotal += &runTest('009', 'Semi-colons in multiline C comment');
$subtotal += &runTest('010', 'Open brace in C comment');
$subtotal += &runTest('011', 'Open brace in C++ comment');
$subtotal = $subtotal * 20 / 5;
$total += floor($subtotal);
&sectionResults('Comments (20 points)', $subtotal, 5, $checkpoint );
$testCount += 5;

&sectionHeader('String and character literals (15 points)');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('012', 'Semi-colon in string literal');
$subtotal += &runTest('013', 'Open brace in char literal');
$subtotal += &runTest('014', 'Escape character in string literal');
$subtotal = $subtotal * 15 / 3;
$total += floor($subtotal);
&sectionResults('String and character literals (15 points)', $subtotal, 3, $checkpoint );
$testCount += 3;

&sectionHeader('For loops (15 points)');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('015', 'Basic for loop');
$subtotal += &runTest('016', 'For loop with line breaks');
$subtotal += &runTest('017', 'For loop with function calls');
$subtotal += &runTest('018', 'For loop with character literal');
$subtotal += &runTest('019', 'Closing parenthesis in literal in loop header');
$subtotal = $subtotal * 15 / 5;
$total += floor($subtotal);
&sectionResults('For loops (15 points)', $subtotal, 5, $checkpoint );
$testCount += 5;

&sectionHeader('Large Inputs (-20 points; indicates more than O(1) memory)');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('020', 'Long file');
$subtotal += &runTest('021', 'Long line');
$subtotal = $subtotal * 1 / 2;
$subtotal = $subtotal < 1 ? -20 : 0;
$total += floor($subtotal);
&sectionResults('Large Inputs (-20 points; indicates more than O(1) memory)', $subtotal, 2, $checkpoint );
$testCount += 2;

&sectionHeader('Digraphs');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('022', 'Non-empty function');
$checkpoint = $total;
$total = 0;
$testCount = 0;
$total += floor($subtotal);
&sectionResults('Digraphs', $subtotal, 1, $checkpoint );
$testCount += 1;

&sectionHeader('Line continuation');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('023', 'In C++ Comment');
$total += floor($subtotal);
&sectionResults('Line continuation', $subtotal, 1, $checkpoint );
$testCount += 1;

