The following exercises are designed to help you practice the skills you’ve learned in the Get Started with C# learning path on Microsoft Learn. Each exercise is self-contained and can be completed independently, but they are best used in conjunction with the corresponding modules on Microsoft Learn.
Level: 100 | Duration: 15 minutes
Write a C# program that uses Console.WriteLine(), Console.ReadLine(), and string interpolation to display a personalized greeting message.
Level: 100 | Duration: 15 minutes
Write a C# program that combines Console.Write(), Console.ReadLine(), and string interpolation to collect multiple pieces of information from the user and display a personalized message.
Level: 100 | Duration: 15 minutes
Write a C# program that declares variables using explicit types and the var keyword, assigns literal values to them, and displays the values.
Level: 100 | Duration: 20 minutes
Write a C# program that stores bill values as variables, performs arithmetic to calculate a tip and total, and accepts amounts as user input using type conversion.
Level: 100 | Duration: 15 minutes
Write a C# program that stores a Fahrenheit temperature, converts it to Celsius using decimal arithmetic, and displays a formatted result.
Level: 100 | Duration: 20 minutes
Write a C# program that simulates rolling dice, uses if, else if, and else to award a prize, and uses logical operators to detect doubles and triples.
Level: 100 | Duration: 20 minutes
Write a C# program that uses if, else if, and else to display a subscription renewal message and discount based on a randomly generated number of days until expiration.
Level: 100 | Duration: 25 minutes
Write a C# program that uses a while loop, conditional logic, and break to run an interactive Guess the Number game.
Level: 100 | Duration: 25 minutes
*Write a C# program that logs game scores in a List
Level: 100 | Duration: 25 minutes
Write a C# program that organizes tax and total calculations into a Billing namespace, using methods with default parameters, named arguments, and return values.
Level: 100 | Duration: 25 minutes
Write a C# program that appends event entries to a log file, then reads them back line by line with a StreamReader.
Note: While you can complete these exercises on their own, they’re designed to complement modules on Microsoft Learn; in which you’ll find a deeper dive into some of the underlying concepts on which these exercises are based.