Practice your debugging skills by tackling the coding challenge in this video. Fix all of the logical errors using breakpoints and other debugging tools in order to create a working solution.
(upbeat music) … - [Woman] Let's tackle another debugging code challenge. … For this challenge, we have some code that attempts to find … the BMI, or body mass index, for each patient … in a collection of patients. … Where each patient has a weight and height value. … Right now, this code does not work, … due to several logical errors, … but let's walk through it's structure. … Starting with the main method, … we create a tuple of patients, … with the initialize patients function. … Jumping up, to this function we have … a tuple as our return value, initialize patients, … and we want to initialize a number of patients, … and so whether it's ten or twenty, … this is going to be the number of patients … we decide to initialize in the array. … So, first, we create a set of patients, … but then we also add some edge cases. … So we have some edge cases up here, … or what if, y'know, there's a patient … with a zero height and a zero weight, … or negative height and negative weight. … So these doubles in here are the height and weight …
- Debugging defined
- Working with breakpoints
- Inspecting values of variables
- Defensive programming
- Common C# errors
- Debugging challenges