Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Microsoft CSharp Programming For The Absolute Beginner (2002) [eng]-1.pdf
Скачиваний:
46
Добавлен:
16.08.2013
Размер:
15.71 Mб
Скачать

//ask for Enter to quit

Console.Write("Please press Enter to continue"); Console.ReadLine();

} // end main } // end class

}// end namespace

As usual, please notice that I added comments to all the right (closing) braces to make it easier to spot the elements I’m ending.

Summary

In this first chapter, you have come a very long way. You have become familiar enough with the basic structure of C# to start poking around in the system documentation. You have learned how to work with the IDE to generate a default console application. You can now interact with the user through a few methods of the console object, and you know how to send special sequences, such as tab and newline, to the screen. You know what a string variable is and how to make one. In short, you’re now a programmer. In the next chapter, you will learn how to have the computer change its behavior with branching statements.

Challenges

Write a program that prints your favorite quote to the screen.

Write a program that asks for a person’s first name, last name, and middle initial and then writes the name in several formats (first, middle, last), (last, first, middle).

Write your own variant of the adventure game. Start by writing a story, and then choose key words to be substituted.

31

Соседние файлы в предмете Программирование на C++