Learning C# Part 2: Language Fundamentals

Written By: Kevin Jordan

- 07 Jul 2006 -

Description: This series aims to take a beginning programmer to an intermediate level in C#. Topics covered in Part 2 include: C# program structure, declaring and intializing variables, characters, strings, constants, enumeration, converting between types, and expressions and operators.

  1. C# Program Structure
  2. Declaring and Using Different Variable Types
  3. Constants and Enumeration
  4. Converting Variables and Using Expressions
  5. Aww Man... Not Homework

Aww Man… Not Homework

So, now you know all about variables in C#. You should be able to declare them, initialize them, perform mathematical operations and a lot of other stuff as well. Time to test that knowledge with a practice problem.

  1. Use the form designer to create a simple calculator with two input fields. Create a simple calculator that can do addition, subtraction, multiplication, and division on the two fields and output the results.

    Hint: Make a button for each mathematical operation and use a click event (by double clicking the button) to perform the math. Be sure to convert the input to a number type.

Yeah, I know this one is a lot tougher than last time, but a calculator (even if this one looks a little wierd) is a real application. If you get this, then this will be you first useful program. If you run into any problems, look to the forums. See you again in Part 3.

<< Previous