We’ve covered a LOT in this lesson so far! You’ve learned about if/else statements for simple control flow, loops, boolean operators, and arrays.
Let’s put together the knowledge from this lesson and the previous ones, and make a more sophisticated program.
Cat Simulator
This program will simulate a cat. You’ll be able to interact with the cat by typing simple commands, and see the status of your cat change.
Create a new Visual Studio project called CatSimulator.
For starters, lets use the Cat class from earlier, and put it into its own file called Cat.cs:
Next, we’ll write a simple program that instantiates a Cat, and then lets the user enter commands to interact with it: