Introduction to C# Applications
- 3.1 Introduction
- 3.2 A Simple C# Application: Displaying a Line of Text
- 3.3 Creating a Simple Application in Visual C# Express
- 3.4 Modifying Your Simple C# Application
- 3.5 Formatting Text with Console.Write and Console.WriteLine
- 3.6 Another C# Application: Adding Integers
- 3.7 Arithmetic
- 3.8 Decision Making: Equality and Relational Operators
- 3.9 Wrap-Up
Objectives
In this chapter you'll learn:
- To write simple C# applications using code rather than visual programming.
- To write input/output statements.
- To declare and use data of various types.
- To store and retrieve data from memory.
- To use arithmetic operators.
- To determine the order in which operators are applied.
- To write decision-making statements.
- To use relational and equality operators.
- To use message dialogs to display messages.
- What's in a name? That which we call a rose by any other name would smell as sweet.
- —William Shakespeare
- When faced with a decision, I always ask, "What would be the most fun?"
- —Peggy Walker
- "Take some more tea," the March Hare said to Alice, very earnestly. "I've had nothing yet," Alice replied in an offended tone, "so I can't take more." "You mean you can't take less," said the Hatter: "it's very easy to take more than nothing."
- —Lewis Carroll
Outline
3.1 |
Introduction |
3.2 |
A Simple C# Application: Displaying a Line of Text |
3.3 |
Creating a Simple Application in Visual C# Express |
3.4 |
Modifying Your Simple C# Application |
3.5 |
Formatting Text with Console.Write and Console.WriteLine |
3.6 |
Another C# Application: Adding Integers |
3.7 |
Arithmetic |
3.8 |
Decision Making: Equality and Relational Operators |
3.9 |
Wrap-Up |
3.1 Introduction
In this chapter, we introduce console applications—these input and output text in a console window, which in Windows XP and Windows Vista is known as the Command Prompt. We use live-code examples to demonstrate input/output, text formatting and arithmetic, equality and relational operators. The optional Software Engineering Case Study section examines the requirements document that specifies what our ATM must do.