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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.