Back to Build 2

Sample Project: How Small Is Big Enough

Reference — Read Before You Scope

divider

Why This Page Exists

Read the Create task's six requirements and it is easy to picture an app: accounts, a database, a dashboard, something with a logo. The requirements do not ask for that.

Below is a complete C# program that meets all six. It is 39 lines, including the blank ones, it took one sitting to write, and somebody could use it in about ninety seconds.

This is not a template and you cannot hand it in. Work that comes from a teacher's sample, a curriculum provider's sample, or a practice task may not be submitted as your own. It is here so you have something to measure against: a floor, not a ceiling, and definitely not a starting file.


The Whole Program

Grade Check
Console.Write("How many classes? ");
int howMany = int.Parse(Console.ReadLine());
string[] classNames = new string[howMany];
int[] averages = new int[howMany];
for (int i = 0; i < howMany; i++)
{
Console.Write("Class name: ");
classNames[i] = Console.ReadLine();
Console.Write("Current average: ");
averages[i] = int.Parse(Console.ReadLine());
}
Console.WriteLine();
Console.WriteLine("Below 70:");
int failing = ClassesBelow(70);
Console.WriteLine($" {failing} class(es)");
Console.WriteLine();
Console.WriteLine("Below 80:");
int shaky = ClassesBelow(80);
Console.WriteLine($" {shaky} class(es)");
int ClassesBelow(int cutoff)
{
int count = 0;
for (int i = 0; i < classNames.Length; i++)
{
if (averages[i] < cutoff)
{
Console.WriteLine($" {classNames[i]} - {averages[i]}");
count = count + 1;
}
}
return count;
}

That is all of it. Nothing was left out to make it fit on the page.


What It Does

Grade Check
How many classes? 4
Class name: Algebra 2
Current average: 84
Class name: Chemistry
Current average: 68
Class name: US History
Current average: 77
Class name: Spanish 3
Current average: 91
Below 70:
Chemistry - 68
1 class(es)
Below 80:
Chemistry - 68
US History - 77
2 class(es)

Look at the two answers. The same method was called twice with a different number and gave back a different list. That is not a nice touch. It is the parameter requirement, made visible.


Where Each Requirement Lives

The Create task is written for every language, so it says list where C# has an array and procedure where C# has a method.

RequirementLinesWhat satisfies it
1 Input2, 10, 12Three questions, and every answer ends up in the arrays that everything else reads
2 List4–5, 10, 12classNames and averages. Delete them and there is nothing left to search
3 Procedure25ClassesBelow(int cutoff), written by the student, with a parameter that changes the result
4 Algorithm26–39Sequencing, iteration at line 29, and selection at line 31: all three inside the method's body
5 Calls17, 22Called twice, with different arguments
6 Output18, 23, 33Depends on what was typed in and on which cutoff was passed

Requirement 4 is the one that fails silently, and it is worth saying exactly what it asks: the loop and the decision have to be inside the method you wrote. Not somewhere in the program. Inside those braces.


The Proposal That Produced It

This is the planning sheet from the Build 1 gate, filled in for the program above. Notice how little there is to say.

Proposal
Program: Grade Check
What it does: you type in each class and your current
average. It tells you which ones are below a cutoff.
Who would use it: me, the night before progress
reports, to work out which class to worry about first.
Input: how many classes, then a name and an
average for each one
Array: classNames and averages, one entry per
class. Without them there is nothing to search
Method: ClassesBelow, parameter cutoff. Pass 70 and
you get one class back; pass 80 and you get two
Inside it: the loop ....... over every class
the decision ... is this average below cutoff?
Output: the classes under the cutoff, and how many

And the Proposal Most People Write First

Proposal
Program: StudySphere
What it does: a study planner with accounts, a calendar,
automatic grade import, reminders, a dashboard and a
phone app.
Who would use it: every student in the school.
Input: log in, courses, assignments, due dates ...
Array: users, courses, assignments, reminders ...
Method: about forty of them
Inside it: ...
Output: ...
Sessions you have ......... 4 for Build 2, 8 for the
Create task
Sessions this needs ....... a great many more than 8
Score if it is finished ......... the same as Grade Check
Score if it is not finished ..... whatever the half-built
version can prove

Finished, this scores exactly what Grade Check scores. There is no bonus for ambition. The rubric asks whether an array is there, whether a method is there, and whether the loop and the decision are inside it, and a 39-line program answers yes just as loudly as a 3,000-line one.

Unfinished, it scores whatever the half-built version can prove, which is usually much less. That is the entire risk, and it is avoidable.

The honest version of the advice: pick something you could describe to somebody in one sentence, build it until it works, and then, only then, add a second feature if the time is there.


The Version That Loses a Point

Here is the same program with the method rewritten. It runs. Given the same answers, it prints character-for-character the same output as the version above.

Grade Check, changed
Console.Write("How many classes? ");
int howMany = int.Parse(Console.ReadLine());
string[] classNames = new string[howMany];
int[] averages = new int[howMany];
for (int i = 0; i < howMany; i++)
{
Console.Write("Class name: ");
classNames[i] = Console.ReadLine();
Console.Write("Current average: ");
averages[i] = int.Parse(Console.ReadLine());
}
Console.WriteLine();
Console.WriteLine("Below 70:");
int failing = 0;
for (int i = 0; i < classNames.Length; i++)
{
if (IsBelow(averages[i], 70))
{
Console.WriteLine($" {classNames[i]} - {averages[i]}");
failing = failing + 1;
}
}
Console.WriteLine($" {failing} class(es)");
Console.WriteLine();
Console.WriteLine("Below 80:");
int shaky = 0;
for (int i = 0; i < classNames.Length; i++)
{
if (IsBelow(averages[i], 80))
{
Console.WriteLine($" {classNames[i]} - {averages[i]}");
shaky = shaky + 1;
}
}
Console.WriteLine($" {shaky} class(es)");
bool IsBelow(int score, int cutoff)
{
if (score < cutoff)
{
return true;
}
return false;
}

The loop moved out of the method. IsBelow is a real method, and it does have a parameter that changes what it does, but its body has only a decision. No loop. So requirement 4 is not met, and the program you see on screen is identical. The loops that remain are in the main program, which the College Board does not count as yours.

This is why the requirement fails silently. You cannot catch it by running the program. You catch it by opening the method and looking for all three things between its braces.


What You May and May Not Do With This

  • Read it, take it apart, and run it. That is what it is for.
  • Use it as a size check. If your plan is more than a few times this big, say so at the gate and cut it down early.
  • Do not submit it, or a lightly edited copy of it. Work taken from a sample and handed in as your own is not your own.
  • Do not pick the same idea. Grade Check is deliberately dull. Yours should be something you actually want.

Your program has to be yours. Not because copying is hard to catch, but because on exam day you write about your own code, from memory, with only your Project Reference in front of you. A program you did not write is a program you cannot describe.

Smaller Than You Think