Skip to content

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"

C# Arrays (Console Application)

Fun with arrays! Arrays are structures that organize related data into sets. This demo application uses the C# Array class members Length and Sort. Although this example is more fun than practical, it demonstrates how Array properties and methods can be used. Array Overview An array stores multiple variables. This structure is helpful with several ...continue reading "C# Arrays (Console Application)"

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"

External data: using text files to store data. We will create a console application that will let us display text from, and save data to, an external data file. After we walk through how to read in data and write it back out, there is an example of how you could build a simple menu ...continue reading "Reading and Writing External Data (C# Console Application)"