O'Reilly logo

Microsoft®C# Programming for the absolute beginner by Andy Harris

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing the Pig Latin Program

The STAIR process led to the development of some pseudocode. Now you have a solid plan, and you know which types of objects, variables, and code structures you will need. It will be relatively simple to translate this plan into a working program.

Setting Up the Variables

With the plan in place, it was easy to figure out a starting point. I did all the normal startup steps and created variables:

 using System; namespace PigLatin { /// <summary> /// Pig Latin interpreter /// Demonstrate loops, string methods /// Andy Harris, 11/16/01 /// </summary> class Pig { static void Main(string[] args) { string pigWord = ""; string sentence = ""; string firstLetter; string restOfWord; string vowels = "AEIOUaeiou"; int letterPos; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required