5. Making decisions in a program

Image

What you will learn

I’ve described a computer as a sausage machine, which accepts an input, does something with it, and then produces an output. This is a great way to start thinking about computers, but a computer actually does a lot more than that. Unlike a real-life sausage machine, which simply tries to create sausage from anything you put in it, a computer is able to respond to different inputs in different ways. In this chapter, you’ll discover how to make your programs respond to different inputs. You’ll also learn about the responsibility that comes with making the computer work in this way—you have to ...

Get Begin to Code with C# now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.