Practice your debugging skills by tackling the coding challenge in this video. Use the tools you've learned so far including breakpoints, the call stack, and the Autos window in order to find all the errors.
(upbeat electronic music) … - [Instructor] It's time to practice your debugging skills … with this code challenge. … Be sure to use all the tools you've learned so far, … including breakpoints, the call stack, … debug mode, and more. … For this challenge, you will be debugging some code … that finds the minimum value in a given array. … In this program, we create a variable called numbers … and feed it into the findMin function. … FindMin contains all of the logic for getting the item … with the least value from the array. … At the end, we print the returning value. … Jumping into Visual Studio Code, we can look … at the program we are going to debug. … First, we have the main method … where we initialize the number's array. … Then we create a variable called Min that's an integer … and store the value that findMin returns … given the argument numbers. … The logic for findMin is up here. … Next, we print out Min to the console … so that variable that has the value findMin returns. … Be sure to check out the exercise files …
- Debugging defined
- Working with breakpoints
- Inspecting values of variables
- Defensive programming
- Common C# errors
- Debugging challenges