C# Foundations · Lesson 18

Review

You can read a small program, change one value, and run it again.

How it works

A foundation program here is top-level statements, decimals, a condition or a short loop, and Console.WriteLine. Collections & LINQ is the next course: it filters a list before adding. Open in Code keeps a project copy the course does not overwrite.

A working example

using System.Linq;

var prices = new[] { 12m, 8m, 25m };

var total = prices
    .Where(p => p >= 10m)
    .Sum();

Console.WriteLine(total);

Expected output

37
Try this
Return to any lesson without losing a project.