Back to Challenge Set 10

Code Challenge: Open Brief — Your Own Program

Difficulty  

divider

The Brief

What they asked for
No brief this time. Build something that uses a loop and a
decision. What it does is up to you. It has to be something a
person could actually run and get something out of.

This is the only page in the quarter that hands you a blank one. That is deliberate. Quarter 2 opens with a two-session build where you choose the project yourself, and this is the small version of it.


Notes

  • Write your plan first and submit it with the code. Not a requirements list this time — a plan, in plain sentences, describing what the program does step by step.
  • Keep it small. A person should be able to use it in under two minutes. A finished small thing beats an abandoned big one, and that is true well beyond this class.
  • It needs at least one loop and at least one decision. Everything else is your call.
  • If nothing comes to mind: a menu that repeats until you pick quit, a quiz that keeps score, a savings or fuel calculator, a dice game that plays until somebody wins, a number-guessing game with a difficulty setting.
  • Use only what this course has taught. Whole numbers, decimals, if and else if, while and for, Random.Shared.Next, and console input. Anything beyond that will be asked about rather than credited.

If You Want It to Run More Than Once

The shortest way to let somebody go again is to ask them with a number, since that is the kind of input you already know how to read:

One way to do it
Console.Write("Go again? 1 for yes, 0 for no: ");
int again = int.Parse(Console.ReadLine());

Wrap the whole program in a while that keeps going while again is 1. But a program whose only loop is the go-again wrapper is a thin one. Aim for a loop that does real work as well.


Sample Output

Sample Output
(There is no sample output. It is your program.)

Your plan is graded the way a requirements list is — on whether it exists and whether it matches what you actually built. Three stars is for the blank page, not for the difficulty of the code.


Submit

Your plan and your program file, named cc-open-loop.

Commence Challenge