c# · level 1 · unit 1 · lesson 4
- meet it
- guess first
- your turn
- fix it
- nailed it
Tap a green word if you get lost.
meet it
An is a clue, not a disaster.
An error is C# saying it got stuck. Everyone gets them, even experts. Before running anything, C# tries to your program, which means checking every line. If one line is wrong, nothing runs at all.
Each message gives a line number and an . CS1002 means a semicolon is missing. CS0103 means C# met a name it does not know, often because of a typo.
C# is , so capitals matter. Console with a capital C works. console with a small c is a stranger, a name C# does not know.
The message tells you which line to look at, so start your search there.
guess first
One small letter. What happens?
Guess before you run it. Wrong guesses are how you learn, and nothing is marked.
using System;
console.WriteLine("Hello!");
your turn
Your turn. Close everything you open.
Type your superpower in place of the blank. Then finish line 3 with a closing quote, a closing bracket and a semicolon, and press run.
output
press run to see what happens
fix it
Breakfast is broken. Can you fix it?
output
press run to see what happens
- Read the error messages. Which line do they point to?
- Every message points at line 4. Count the quote marks on that line.
- A string needs a quote at both ends. Add " before Come, then press run.
nailed it
you turned errors into clues. :D
- Errors are clues. Read the error code and the line number.
- C# checks the whole program before any of it runs.
- C# is case-sensitive:
Consoleworks,consoledoes not.
new words in your collection
- error
- compile
- error code
- case-sensitive
This lesson isn’t saved. A free account remembers every lesson you finish.