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

Creating a Menu

Menus are a mainstay of console-based programming and a great place to practice your method-building skills. You can begin to build the Critter program by building the menu structure for it. In Figure 4.8, you can see the output of the Critter Menu program described in the next section.

Figure 4.8. The menu for the Critter program is a standard console menu.

Creating a Main Loop

When programmers use a method, they often refer to it as calling the method. The Main loop calls a method to display the menu and then uses a switch statement to perform various tasks, based on the results. The entire assembly is enclosed inside a while loop, ...

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