From the course: C# Exception and Error Handling
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Challenge: Basics - C# Tutorial
From the course: C# Exception and Error Handling
Challenge: Basics
- [Instructor] All right, let's try a programming challenge. So for this challenge, you're going to create a simple program that reads in two integer numbers and performs a user-specified operation on them. So I'm going to run my finished code so you can see what the application looks like. So here in my finished chapter two, I'm going to open up my finished challenge, and let's give this a full screen and I'm going to run the code. All right, so you can see I'm being prompted for the first integer number, so I'll enter 10. And then, "Enter the second integer number," and I'll enter five. And then, "Enter the operation," I can either add, subtract, multiply, divide, or I can type exit to quit. So I'll choose D for divide. And you can see the result is two, okay? So the program needs to be able to handle exception conditions. So for example, if I enter a value that's not a number, so I'll enter A and then B, and then I'll do add, right? You can see that I'm getting this message that…