Loading...

C# Summary

Run the Pine file one more time, change nothing, and name the part of the course behind every line it prints. This page adds no new call and no new type. It reads a program you built step by step, places it on one map of the course, and stops before compiling. There is no quiz here. The check is whether you can explain each line of the screen without looking it up.
Quality and Wrap-up continues, so the file is still Pine, with Add, left, right, the fixed day, and the die. The random page ended with four lines: left=10 right=2 sum=12, 2026-03-05, roll= with a number from 1 to 6, and inRange=True. That screen is the starting point here. If your copy no longer prints all four, fix it before you read further. If the roll line is missing, put back Random rng = new Random(); and int roll = rng.Next(1, 7);. If the second line is today's date, put back new DateTime(2026, 3, 5).

The file you already have

Open the Pine file. Keep the class name Pine. Keep Add with its four /// lines. Keep the tight sum format, the date with {0:yyyy-MM-dd}, one new Random(), one Next(1, 7), and the bool check. Do not add a loop of rolls, a list, a file write, or a second class to make the review feel bigger. The file below is the same file the random page ran.
Run dotnet run. The screen shows:
left=10 right=2 sum=12
2026-03-05
roll= and one number from 1 to 6
inRange=True
Three of those lines are the same on every run. The roll can change. That mix is the point of the file: values you stored, a value you computed, a day you chose, a number you did not choose, and a rule you can always check.

The Pine file the course built

csharp
using System;

public class Pine
{
    /// <summary>Adds the two stored numbers.</summary>
    /// <param name="left">The first number.</param>
    /// <param name="right">The second number.</param>
    /// <returns>The sum of left and right.</returns>
    public static int Add(int left, int right)
    {
        return left + right;
    }

    public static void Main()
    {
        int left = 10;
        int right = 2;
        int sum = Add(left, right);
        Console.WriteLine("left={0} right={1} sum={2}", left, right, sum);
        DateTime day = new DateTime(2026, 3, 5);
        Console.WriteLine("{0:yyyy-MM-dd}", day);
        Random rng = new Random();
        int roll = rng.Next(1, 7);
        Console.WriteLine("roll={0}", roll);
        Console.WriteLine("inRange={0}", roll >= 1 && roll <= 6);
    }
}

Read it from the top

using System; lets the file write Console, DateTime, and Random without the long name. The using page taught that. public class Pine is a class, and public static void Main() is where the run starts. The first program and the classes pages taught that shape, and the static page explained why Main and Add need no object.
The four /// lines are XML documentation. They describe Add for a reader and an editor. They do not change the screen. Add(int left, int right) is a method with two parameters and an int return value. The methods, parameters, and return pages built it. The names left and right are camelCase, and Pine and Add are PascalCase, which is the naming page.
int left = 10; is a variable of a value type. return left + right; is an operator on two ints. If that plus were a minus, the first line would end in 8, which is the bug the debugging page found by printing values.

Read the screen line by line

The first line, left=10 right=2 sum=12, comes from one Console.WriteLine with three slots: {0}, {1}, and {2}. That is the formatting page. The numbers inside it come from variables, a method call, and a return value.
The second line, 2026-03-05, comes from new DateTime(2026, 3, 5) and the pattern yyyy-MM-dd. That is the dates page. March is 3 because January is 1. MM and dd add the leading zeros.
The third line is roll= and a number. It comes from rng.Next(1, 7), which draws 1 to 6 and never 7. That is the random page. The fourth line, inRange=True, prints a bool. The booleans page showed that C# writes it with a capital T. The comparison page taught >= and <=. The logical operators page taught &&, which is true only when both sides are true.
If you can say those three sentences out loud while the screen is in front of you, the file is no longer a sample you copied. It is a program you can read.

What Pine leaves out

A short file cannot show the whole course. Pine has no if, no loop, no array, no list, no dictionary, no file, no try and catch, and no base class. Those skills are real and you used them. They live on their own pages, each with its own small demo. Do not paste them into Pine for this review. A summary that grows new code is a new lesson, and it hides the four lines you are trying to read.
The table names the ten modules of the course and one result each one gave you. Open the matching page only when a result feels thin. The table has no questions, and it is not a second course.

📊 Ten modules on the C# path

Module What you can show
Start install .NET, run dotnet run, print a line, write a comment, read input
Types store ints, strings, bools, and arrays, cast on purpose, handle null
Operators compute with +, compare with == and >=, join tests with &&
Flow choose with if and switch, repeat with for, while, and foreach
Methods pass parameters, return a value, overload a name, keep scope clear, recurse
Classes build a class with fields and a constructor, use this, static, access, namespace, using
Collections keep values in a List, a Dictionary, or a HashSet, and loop over them
Files throw and catch exceptions, read and write a text file, build a path
Inheritance extend a class, call base, override, implement an interface, use enums and Equals
Quality debug by printing, document with ///, name clearly, format, print a date, draw a random number

Mistakes this page refuses

Do not add new syntax to Pine to make the summary longer. If a line on the screen is wrong, fix the line that prints it. If the first line ends in 8, put the plus back in Add. If the second line has no zeros, use MM and dd. If the third line says roll=0, the call is Next(6) without + 1. If the fourth line says False, the bounds in Next are wrong.
Do not expect one exact roll. A screen that shows roll=3 on one run and roll=5 on the next is correct. Do not treat this page as a quiz. It has none by design, because every page before it already asked graded questions. Do not read the module table as a list of chores. Each row is something you have already done once.
Keep one Pine. Keep one Main. Keep Add and its documentation. Keep the four print calls.

Why the review sits here

The course moved from a first program to a file with a method, documentation, a format line, a date, and a random draw. Without one stop to read it whole, it is easy to remember each page as a separate trick. This page puts the tricks back in one place. The same left and right that the naming page chose are still the parameters. The same format line from the formatting page still prints them. The date and the roll sit under them without changing the sum.
A beginner who can explain this screen can also open any earlier page and see why it was needed. That is the only skill this page checks.

Compiling stays shut

You can run Pine unchanged, read the four lines it prints, and name the page behind each one. The next page, compiling, looks at what dotnet build produces and what happens between saving the file and seeing the screen. This page stops before that job. It used dotnet run the same way every earlier page did, and it does not open the build output.
Run dotnet run once more. If the screen shows left=10 right=2 sum=12, then 2026-03-05, then roll= with a number from 1 to 6, then inRange=True, and you can say where each line came from, this summary did its job.