Skip to content

screenshot of C# code

Learn what it means to convert data from one type to another in C# (type conversion). C#, like most programming languages, has several built-in data types such as integer, string, and boolean. These classifications determine the range of values a variable of that type can hold, how the data will be stored, and what can ...continue reading "C# Type Conversion (and Coffee!)"

screenshot of Visual Studio suggestion for an error

Practice debugging and troubleshooting. Solving code problems can be a challenge, especially when the errors aren't obvious. With a bit of debugging practice, though, you can learn to quickly identify and fix common errors. One of the ways you can practice your troubleshooting and critical thinking skills is to take an application that is broken, ...continue reading "Debugging Code: Poem Generator (C#)"

C# Random Fortune

Get a random fortune! Create a random fortune generator; a C# console application that selects a random element from a string array. The output is formatted to resemble the slip of paper found in a fortune cookie. Array of strings Instance of Random Formatting output Example Output UML Code The code for our random fortune ...continue reading "C# Random Fortune"

ConsoleColor as Parameter (Console Application)

Using an object as a method parameter! This short example shows how you can make a ConsoleColor object (myColor) and pass it as an argument to a method. The method uses the object to change text color. After a message is typed into the console window, it is printed in color. Then color is reset ...continue reading "ConsoleColor as Parameter (Console Application)"

Random words, an array, and conditional statements. Create a word guessing game that asks a player to guess a random word. As we build the C# console application, we'll discuss some fundamental programming concepts. We'll build upon the code we started in . (If you haven't read it yet, you might want to start there!) ...continue reading "Word Guessing Game: C# Console Application"

Numeric Guessing Game

Type conversion, random numbers, and conditional statements. We'll create a game where the player will try to guess a random number. Fundamental programming concepts will be covered as we build the C# console application. Numeric Guessing Game Framework The framework for our game will have two classes: Program and Game. A method (Play) in the ...continue reading "Numeric Guessing Game: C# Console Application"

Iterating our simple C# Madlib code This is part two in a series to create iterative versions of a Madlib in C#. If you haven't read through , start there! Next Iteration A good practice is to keep the amount of code in our Main() function to a minimum. The first step we'll do in ...continue reading "Simple C# Madlib (Part Two)"