# First Language Project

Part of the Programming Merit Badge Digital Resource Guide: [Introduction & Overview](https://merit-badge.university/merit-badges/programming/guide/index.md)

*5. Building Programs*

> **5a.** In the first language and environment, write or modify a program, debug and demonstrate, and explain as above.

Your first project is where you build the pattern you will repeat for the rest of this badge: plan a small program, make it work, debug it, and explain it clearly. This is a great place to choose a language that feels readable and an environment that gives you quick feedback.

## What your first project should do

The requirement gives you a clear target. Your program must:

- take **input**
- make **computations**
- use **decisions** based on the input
- produce **output**

That means a program that only prints "Hello, world" is too simple. A stronger first project might:

- ask for a user's age and decide which ticket price applies
- ask for test scores and calculate an average
- ask for camping gear counts and warn if a required item is missing
- ask for weather conditions and suggest an activity based on rules you choose

## Build small on purpose

Many beginners try to impress people with a huge idea. That usually leads to confusion, unfinished features, and bugs you cannot explain. A better plan is to build a small program with logic you understand completely.

**A good first project** — Use this to test whether your idea fits the badge

- [ ] The input is clear and easy to demonstrate.
- [ ] The program has at least one meaningful calculation.
- [ ] The program uses decision logic such as if/else or match/case.
- [ ] The output clearly changes based on what the user entered.
- [ ] You can explain each major part without guessing.

## Debugging is part of the requirement

A bug is simply a mistake in the program's behavior. You are expected to find and fix problems. That is not a side task — it is part of how programming works.

Common first-project bugs include:

- forgetting to convert text input into a number
- checking the wrong condition in an if statement
- using the wrong variable name
- outputting a result before the calculation is finished

> **Tip**
>
> When your program misbehaves, change one thing at a time. Test again after each change. That makes it much easier to see what fixed the problem.

## How to explain your program to your counselor

When you demonstrate the project, walk through it in a simple order:

1. **Input** — What does the user enter?
2. **Processing** — What calculations happen?
3. **Decision making** — What rules decide what happens next?
4. **Output** — What result does the user see?

If you can tell that story clearly, you are not just showing code. You are showing understanding.

[MDN Web Docs — Learn programming](https://developer.mozilla.org/en-US/docs/Learn): MDN offers clear beginner lessons on programming logic, debugging, and building small projects you can actually explain.

> **Be Prepared! Your program works only for one test case**
>
> That is a warning sign that your logic may be too narrow.
>
> - **Try new inputs**: Test normal, unusual, and edge-case values.
> - **Watch the branches**: Make sure each decision path actually runs when it should.
> - **Check your math**: A correct formula with the wrong variable still gives the wrong answer.
> - **Retest after each fix**: Do not pile multiple changes together if you can help it.

![A flowchart showing user input leading to calculation, decision branch, and final output on screen](https://ik.imagekit.io/doulacoop/tr:w-800/mbu-assets/merit-badges/programming/guide/simple-program-flow?v=e8abb439)

Once you finish this first project, you will have a model to reuse. The next two projects should show what stays the same across languages — and what changes.

---

- Previous: [Choosing Your Three Projects](https://merit-badge.university/merit-badges/programming/guide/req5/index.md)
- Next: [Second Language Project](https://merit-badge.university/merit-badges/programming/guide/req5b/index.md)
