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#)"
Tag: method
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)"
Word Guessing Game: C# 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: C# Console Application
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"
Simple C# Madlib (Part Three)
Arrays and loops can make our Madlib code more organized. This is part three in a series to create iterative versions of a Madlib in C#. If you haven't read through , start there! Focusing primarily on improving our code, we'll add two arrays and a loop. By using an array we can condense the ...continue reading "Simple C# Madlib (Part Three)"
Reading and Writing External Data (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)"