Breakpoints in Functions

Introduction

We know that, in a source file, we can create functions. We can then involve breakpoints in the functions. We can create a breakpoint inside or outside a function.

Practical LearningPractical Learning: Introducing Breakpoints and Functions

  1. Start Microsoft Visual Studio
  2. Create a new Console App named ObliqueTriangles3
  3. Change the document as follows:
    using static System.Console;
    
    double GetValue(string identity, string msg)
    {
        double value = default;
    
        try
        {
            Write(identity);
            value = Convert.ToDouble(ReadLine()!);
        }
        catch (FormatException)
        {
            WriteLine(msg);
        }
    
        return value;
    }
    
    (double first, double second, double third) Calculate(TriangleType category, double known1, double known2, double known3)
    {
        double value1 = 0.00;
        double value2 = 0.00;
        double value3 = 0.00;
    
        switch (category)
        {
            case TriangleType.AngleAngleSide:
                // Here, we use the law of sines
                value1 = 180 - (known1 + known2);
                value2 = known3 * Math.Sin(known2 * Math.PI / 180) / Math.Sin(known1 * Math.PI / 180);
                value3 = known3 * Math.Sin(value1 * Math.PI / 180) / Math.Sin(known1 * Math.PI / 180);
    
                return (value1, value2, value3);
    
            case TriangleType.AngleSideAngle:
                // Here, we use the law of sines
                value1 = 180 - (known1 + known3);
                value2 = known2 * Math.Sin(known3 * Math.PI / 180) / Math.Sin(known1 * Math.PI / 180);
                value3 = known2 * Math.Sin(value1 * Math.PI / 180) / Math.Sin(known1 * Math.PI / 180);
    
                return (value1, value2, value3);
    
            case TriangleType.Unknown:
                return (0.00, 0.00, 0.00);
    
            case TriangleType.SideAngleSide:
                // Here, we use the law of cosines
                value1 = Math.Sqrt((known1 * known1) +
                                   (known3 * known3) -
                                   (2 * known1 * known3 * Math.Cos(known2 * Math.PI / 180)));
                value2 = Math.Acos(((value1 * value1) +
                                    (known3 * known3) -
                                    (known1 * known1)) /
                                    (2 * value1 * known3)) * 180 / Math.PI;
                value3 = 180 - (known2 + value2);
    
                return (value1, value2, value3);
    
            default:
                return (0.00, 0.00, 0.00);
    
            case TriangleType.SideSideSide:
                // Here, we use the law of cosines
                value1 = Math.Acos(((known3 * known3) +
                                    (known2 * known2) -
                                    (known1 * known1)) /
                                    (2 * known3 * known2)) * 180 / Math.PI;
                value2 = Math.Acos(((known3 * known3) +
                                    (known1 * known1) -
                                    (known2 * known2)) /
                                    (2 * known3 * known1)) * 180 / Math.PI;
                value3 = 180 - (value1 + value2);
    
                return (value1, value2, value3);
        }
    }
    
    void CalculateAAS()
    {
        double AASAngle1 = 0.00;
        double AASAngle2 = 0.00;
        double AASSide1  = 0.00;
        
        WriteLine("AAS Shape");
        WriteLine("----------------------------------------------------------------------");
        WriteLine("Known Values:  Known Values: 2 sides and the 1 angle between them");
        WriteLine("Sought Values: 2 angles and the 1 sides between them");
        WriteLine("----------------------------------------------------------------------");
    
        AASAngle1 = GetValue("AAS Angle 1: ", "You must type a value for the lower left angle of the AAS shape.");
        AASAngle2 = GetValue("AAS Angle 2: ", "You must type a value for the lower right angle of the AAS shape.");
        AASSide1  = GetValue("AAS Side  1: ", "You must type a value for the right side of the AAS shape.");
    
        (double AASAngle3, double AASSide2, double AASSide3) results = Calculate(TriangleType.AngleAngleSide, AASAngle1, AASAngle2, AASSide1);
    
        WriteLine("======================================================================");
        WriteLine("Results");
        WriteLine("----------------------------------------------------------------------");
        WriteLine("AAS Angle 3:  " + results.AASAngle3);
        WriteLine("AAS Side  2:  " + results.AASSide2);
        WriteLine("AAS Side  3:  " + results.AASSide3);
    }
    
    void CalculateASA()
    {
        double ASAAngle1 = 0.00;
        double ASAAngle2 = 0.00;
        double ASASide1  = 0.00;
    
        WriteLine("ASA Shape");
        WriteLine("----------------------------------------------------------------------");
        WriteLine("Known Values:  2 angles and the 1 side joining them");
        WriteLine("Sought Values: 2 sides and the 1 angle between them");
        WriteLine("----------------------------------------------------------------------");
    
        ASAAngle1 = GetValue("ASA Angle 1: ", "You must type a value for one of the known angles of the ASA shape.");
        ASASide1  = GetValue("ASA Side  1: ", "You must type a value for the side that is between the angles whose values are about the ASA shape.");
        ASAAngle2 = GetValue("ASA Angle 2: ", "You must type a value for the other known angle of the ASA oblique triangle.");
    
        (double ASAAngle3, double ASASide2, double ASASide3) results = Calculate(TriangleType.AngleSideAngle, ASAAngle1, ASASide1, ASAAngle2);
    
        WriteLine("======================================================================");
        WriteLine("Results");
        WriteLine("----------------------------------------------------------------------");
        WriteLine("ASA Angle 3:  {0}", results.ASAAngle3);
        WriteLine("ASA Side  2:  {0}", results.ASASide2);
        WriteLine("ASA Side  3:  {0}", results.ASASide3);
    }
    
    void CalculateSAS()
    {
        WriteLine("SAS Shape");
        WriteLine("----------------------------------------------------------------------");
        WriteLine("Known Values:  2 sides and 1 angle");
        WriteLine("Sought Values: 1 unknown side and 2 unknown angles");
        WriteLine("----------------------------------------------------------------------");
    
        WriteLine("Type the known values");
    
        double SASSide1  = GetValue("SAS Side  1: ", "You must type a value for one of the known sides of the SAS shape.");
        double SASAngle1 = GetValue("SAS Angle 1: ", "You must type a value for the known angle of the SAS shape.");
        double SASSide2  = GetValue("SAS Side  2: ", "You must type a value for the other known side of the SAS shape.");
    
        (double SASSide3, double SASAngle2, double SASAngle3) results = Calculate(TriangleType.SideAngleSide, SASSide1, SASAngle1, SASSide2);
    
        WriteLine("======================================================================");
        WriteLine("Results");
        WriteLine("----------------------------------------------------------------------");
        WriteLine("SAS Side  3: {0}", results.SASSide3);
        WriteLine("SAS Angle 2: {0}", results.SASAngle2);
        WriteLine("SAS Angle 3: {0}", results.SASAngle3);
    }
    
    void CalculateSSS()
    {
        WriteLine("SSS Shape");
        WriteLine("----------------------------------------------------------------------");
        WriteLine("Known Values:  All 3 sides");
        WriteLine("Sought Values: All 3 angles");
        WriteLine("----------------------------------------------------------------------");
    
        double SSSSide1 = 0.00;
        double SSSSide2 = 0.00;
        double SSSSide3 = 0.00;
    
        WriteLine("Type the known values");
    
        SSSSide1 = GetValue("SSS Side 1:  ", "You must type a value for one of the known sides of the SSS shape.");
        SSSSide2 = GetValue("SSS Side 2:  ", "You must type a value for another side of the SSS triangle.");
        SSSSide3 = GetValue("SSS Side 3:  ", "You must type a value for the remaining known side of the SSS oblique triangle.");
    
        (double SSSAngle1, double SSSAngle2, double SSSAngle3) results = Calculate(TriangleType.SideSideSide, SSSSide1, SSSSide2, SSSSide3);
    
        WriteLine("======================================================================");
        WriteLine("Results");
        WriteLine("----------------------------------------------------------------------");
        WriteLine($"SSS Angle 1: {results.SSSAngle1}");
        WriteLine($"SSS Angle 2: {results.SSSAngle2}");
        WriteLine($"SSS Angle 3: {results.SSSAngle3}");
    }
    
    WriteLine("======================================================================");
    WriteLine("This application allows you to make calculations on oblique triangles");
    WriteLine("======================================================================");
    
    Title = "Oblique Triangles";
    
    WriteLine("Available shape options:");
    WriteLine("1 - AAS (Known: Angle - Angle - Side)");
    WriteLine("2 - ASA (Known: Angle - Side  - Angle)");
    WriteLine("3 - SAS (Known: Side  - Angle - Side)");
    WriteLine("4 - SSS (Known: Side  - Side  - Side)");
    WriteLine("Q - Quit");
    Write("What type of triangle do you want to process? ");
    string selection = ReadLine()!;
    
    switch (selection)
    {
        case null:
            break;
        case "4":
            CalculateSSS();
            break;
        case "3":
            CalculateSAS();
            break;
        default:
            break;
        case "1":
            CalculateAAS();
            break;
        case "2":
            CalculateASA();
            break;
    }
    
    WriteLine("======================================================================");
    
    public enum TriangleType
    {
        Unknown        = 0,
        AngleAngleSide = 100,
        AngleSideAngle = 200,
        SideAngleSide  = 500,
        SideSideSide   = 700
    }

Creating a Breakpoint for a Function

You can create a breakpoint in the body of a function. You can also create a breakpoint on the return value of a function; that is, where a function is called. After doing this, if you ask the compiler to Start Debugging, the execution would start but pause where the breakpoint was created.

Practical LearningPractical Learning: Introducing Breakpoints with Functions

  1. In the Code Editor, click the margin on the left side of "AASAngle2 = GetValue("AAS Angle 2: ", "You must type a value for the lower right angle of the AAS shape.");" to create a breakpoint

    Introducing Breakpoints with Functions

  2. On the main menu, click Debug -> Start Debugging.
    Notice that the DOS window displays

    Debugging - Running to a Breakpoint

  3. When asked about the primary options, type 1 and press Enter
  4. When the value of AAS Angle 1 is requested, type 13 and press Enter.
    Notice that the breakpoint that was created has been accessed:

    Debugging - Running to a Breakpoint

  5. On the main menu of Microsoft Visual Studio, click Debug and cick Continue
  6. When the value of AAS Angle 2 is requested, type 17 and press Enter
  7. When the value of AAS Side 1 is requested, type 5 and press Enter:
    ======================================================================
    This application allows you to make calculations on oblique triangles
    ======================================================================
    Available shape options:
    1 - AAS (Known: Angle - Angle - Side)
    2 - ASA (Known: Angle - Side - Angle)
    3 - SAS (Known: Side - Angle - Side)
    4 - SSS (Known: Side - Side - Side)
    Q - Quit
    What type of triangle do you want to process? 1
    AAS Shape
    ----------------------------------------------------------------------
    Known Values:  Known Values: 2 sides and the 1 angle between them
    Sought Values: 2 angles and the 1 sides between them
    ----------------------------------------------------------------------
    AAS Angle 1: 13
    AAS Angle 2: 17
    AAS Side 1:  5
    ======================================================================
    Results
    ----------------------------------------------------------------------
    AAS Angle 3:  150
    AAS Side  2:  6.498562666788197
    AAS Side  3:  11.1135287064645
    ======================================================================
    
    Press any key to close this window . . .
  8. To remove the breakpoint, on the main menu, click Debug -> Toggle Breakpoint

Creating Breakpoints for Functions

As you should know already, you can create as many breakpoints as you want in your project. In the same way, if you judge it necessry, you can create breakpoints inside or outside functions.

Practical LearningPractical Learning: Creating Breakpoints for Functions

  1. In the Code Editor, click anywhere on the double ASAAngle1 = 0.00; line to give it focus
  2. On the main menu of Microsoft Visual Studio, click Debug and click Toggle Breakpoint
  3. In the Code Editor, right-click anywhere on the ASASide1 = GetValue("ASA Side 1: ", "You must type a value for the side that is between the angles whose values are about the ASA shape."); line -> Breakpoint -> Insert Breakpoint:

    Debugging - Running to a Breakpoint

  4. Click CalculateASA();
  5. Press F9 to create a breakpoint
  6. To start debugging, on the main menu of Microsoft Visual Studio, click Debug and click Start Debugging
  7. When the shape option is requested, type 3 and press Enter
  8. When the value of SAS Side 1 is requested, type 35 and press Enter
  9. When the value of SAS Angle 1 is requested, type 117 and press Enter
  10. When the value of SAS Side 2 is requested, type 42 and press Enter:
    ======================================================================
    This application allows you to make calculations on oblique triangles
    ======================================================================
    Available shape options:
    1 - AAS (Known: Angle - Angle - Side)
    2 - ASA (Known: Angle - Side - Angle)
    3 - SAS (Known: Side - Angle - Side)
    4 - SSS (Known: Side - Side - Side)
    Q - Quit
    What type of triangle do you want to process? 3
    SAS Shape
    ----------------------------------------------------------------------
    Known Values:  2 sides and 1 angle
    Sought Values: 1 unknown side and 2 unknown angles
    ----------------------------------------------------------------------
    Type the known values
    SAS Side  1: 35
    SAS Angle 1: 117
    SAS Side  2: 42
    ======================================================================
    Results
    ----------------------------------------------------------------------
    SAS Side  3: 65.75509158410675
    SAS Angle 2: 28.311396001995423
    SAS Angle 3: 34.68860399800457
    ======================================================================
    
    Press any key to close this window . . .
    Notice that no breakpoint was accessed
  11. To execute again, on the main menu of Microsoft Visual Studio, click Debug and click Start Debugging:

    Debugging - Running to a Breakpoint

  12. When the shape option is requested, type 2 and press Enter.
    Notice that one of the breakpoints is accessed:

    Debugging - Running to a Breakpoint

  13. To continue debugging, on the Standard toolbar, click Continue.
    Notice that another breakpoint is accessed:

    Debugging - Running to a Breakpoint

    Position the mouse on ASAAngle1 = 0.00, on ASAAngle2 = 0.00, and on ASASide1 = 0.00 (where the variables are declared) to see their values (everyone of them should be 0).
    Also position the mouse on ASAAngle1, on ASASide1, and on ASAAngle2, where the variables are assigned GetValue(), to see their values (everyone of them should be 0).
    Also position the mouse on ASAAngle1, on ASASide1, and on ASAAngle2, where the variables are accessed in the parentheses of Calculate(), to see their values (everyone of them should be 0)
  14. To continue debugging, on the Standard toolbar, click Continue

    Debugging - Running to a Breakpoint

  15. When the value of ASA Angle 1 is requested, type 73.2 and press Enter.
    Notice that another breakpoint is accessed:

    Debugging - Running to a Breakpoint

    In the Code Editor, position the mouse on ASAAngle1 = 0.00 where the variables are declared. It should display its current value (73.2).
    Position the mouse on ASAAngle2 = 0.00 and on ASASide1 = 0.00 (where those variables are declared) to see their values (they should display 0).
    Position the mouse on ASAAngle1 where it is assigned GetValue(). It should display its current value (73.2).
    Position the mouse on ASASide1 and on ASAAngle2, where they are assigned GetValue(), to see their values (they should display 0).
    Position the mouse on ASAAngle1, where it is accessed in the parentheses of Calculate(). It should display its current value (73.2).
    Position the mouse on ASAAngle2 and ASASide1, where they are accessed in the parentheses of Calculate(), to see their values (they should display 0)
  16. To continue debugging, on the main menu of Microsoft Visual Studio, click Debug and click Continue.
  17. When the value of ASA Side 1 is requested, type 117 and press Enter
  18. When the value of ASA Angle 2 is requested, type 54.1 and press Enter:
    ======================================================================
    This application allows you to make calculations on oblique triangles
    ======================================================================
    Available shape options:
    1 - AAS (Known: Angle - Angle - Side)
    2 - ASA (Known: Angle - Side - Angle)
    3 - SAS (Known: Side - Angle - Side)
    4 - SSS (Known: Side - Side - Side)
    Q - Quit
    What type of triangle do you want to process? 2
    ASA Shape
    ----------------------------------------------------------------------
    Known Values:  2 angles and the 1 side joining them
    Sought Values: 2 sides and the 1 angle between them
    ----------------------------------------------------------------------
    ASA Angle 1: 73.2
    ASA Side 1:  117
    ASA Angle 2: 54.1
    ======================================================================
    Results
    ----------------------------------------------------------------------
    ASA Angle 3:  52.69999999999999
    ASA Side  2:  99.00025245122877
    ASA Side  3:  97.2197866020223
    ======================================================================
    
    Press any key to close this window . . .
  19. In the Code Editor, right-click the button of the breakpoint in the margin of double ASAAngle1 = 0.00; and click Disable Breakpoint
  20. Right-click the ASASide1 = GetValue("ASA Side 1: ", "You must type a value for the side that is between the angles whose values are about the ASA shape."); line -> Breakpoint -> Disable Breakpoint
  21. Click CalculateASA();
  22. Then, press Ctrl + F9 to disable the breakpoint
  23. In the Code Editor, right-click anywhere on the SSSSide2 = GetValue("SSS Side 2: ", "You must type a value for another side of the SSS triangle."); line -> Breakpoint -> Insert Breakpoint
  24. Still in the Code Editor, right-click CalculateSSS(); -> Breakpoint -> Insert Breakpoint

Stepping Into Breakpoints

After creating breakpoints involved with functions, you can use the features of Step Into and/or the Step Over to debug your code.

Practical LearningPractical Learning: Stepping to Breakpoints with Functions

  1. To start debugging, on the main menu, click Debug -> Step Into.
    Make sure you can see the Code Editor, the Locals window, and the DOS window

    Debugging - Breakpoint - Stepping Into ...

  2. To continue debugging, on the Debug toolbar, click the Step Into button Step Into a few (12) times until the focus moves to the DOS window
  3. When the shape option is requested, type 4 and press Enter:

    Debugging - Breakpoint - Stepping Into ...

  4. To continue debugging, on the main menu of Microsoft Visual Studio, click Debug and click Step Into
  5. To continue debugging, on the main menu of Microsoft Visual Studio, click Debug and click Step Into.
    Notice that the debugging moves to the CalculateSSS() method in the opening curly bracket:

    Debugging - Breakpoint - Stepping Into ...

  6. To continue debugging, on the main menu of Microsoft Visual Studio, click Debug and click Step Into.
    Notice that the debugging moves to the first line in the body of the CalculateSSS() method
  7. To continue debugging, on the Debug toolbar, click the Step Into button Step Into five times to reach the first variable declaration.
    Position the mouse on SSSSide1 = 0.00, on SSSSide2 = 0.00, and on SSSSide3 = 0.00 (where the variables are declared) to see their values (they should produce 0).
    Position the mouse on SSSSide1, on SSSSide2, and on SSSSide3, where the variables are accessed in the parentheses of Calculate(), to see their values (everyone of them should display 0).
    Position the mouse on results.SSSAngle1, on results.SSSAngle2, and on results.SSSAngle3 to see their values
  8. To continue debugging, press F11 continually (5 times) until the focus moves to the body of the GetValue() function.
    Notice the value on the right side of "double GetValue(string identity, string msg)":

    Debugging - Breakpoint - Stepping Into ...

  9. To continue debugging, press F11 continually (5 times) until the focus moves to the DOS window
  10. When the SSS Side 1 value is requested, type 5 and press Enter.
    Notice the value on the right side of double GetValue(string identity, string msg).
    Notice the ToDouble Returned expression and its value:

    Debugging - Breakpoint - Stepping Into ...

  11. To continue debugging, on the main menu of Microsoft Visual Studio, click Debug and click Step Into twice.
    Notice the value on the closing curly bracket of the double GetValue(string identity, string msg) function:

    Debugging - Breakpoint - Stepping Into ...

  12. To continue debugging, on the main menu of Microsoft Visual Studio, click Debug and click Step Into.
    Notice thhat the debugging focus moves to the "SSSSide1 = GetValue()" function call
  13. To continue debugging, press F11 and notice that the first breakpoint is accessed.
    Notice the values in the Locals window:

    Debugging - Breakpoint - Stepping Into ...

    In the Code Editor, position the mouse on SSSSide1 = 0.00 where the variable is declared. Its current value should appear (5).
    Position the mouse on SSSSide2 = 0.00 and on SSSSide3 = 0.00, where the variables are declared, to see their values (they should display 0).
    Position the mouse on SSSSide1 where it is assigned GetValue(). It should display its current value (5).
    Position the mouse on SSSSide2 and on SSSSide3, where they are assigned GetValue(), to see their values (they should display 0).
    Position the mouse on SSSSide1, where it is accessed in the parentheses of Calculate(). It should display its current value (5).
    Position the mouse on SSSSide2 and SSSSide3, where they are accessed in the parentheses of Calculate(), to see their values (they should display 0).
    Position the mouse on results.SSSAngle1, on results.SSSAngle2, and on results.SSSAngle3 to see their values
  14. To continue debugging, on the main menu of Microsoft Visual Studio, click Debug and click Step Into a few times (6 times) until the focus moves to the DOS window
  15. When the SSS Side 1 value is requested, type 7 and press Enter.
    Notice the value on the right side of "double GetValue(string identity, string msg)".
    Notice the ToDouble Returned expression and its value.
    Notice the values in the Locals window:

    Debugging - Breakpoint - Stepping Into ...

  16. To continue debugging, on the Debug toolbar, click the Step Into button Step Into twice.
    Notice the value on the right side of the closing curly bracket of the function (7)
  17. To continue debugging, on the Debug toolbar, click the Step Into button Step Into.
    Notice that the first breakpoint is accessed again.
    Notice the values in the Locals window
  18. To continue debugging, on the Debug toolbar, click the Step Into button Step Into.
    The debugging operation moves to the next line.
    .
    Notice the values in the Locals window:

    Debugging - Breakpoint - Stepping Into ...

    In the Code Editor, position the mouse on SSSSide1 = 0.00 where the variable is declared. Its current value should appear (5).
    Position the mouse on SSSSide2 = 0.00 where the variable is declared. Its current value should appear (7).
    Position the mouse on SSSSide3 = 0.00 where the variable is declared to see its current value (0).
    Position the mouse on SSSSide1 where it is assigned GetValue(). It should display its current value (5).
    Position the mouse on SSSSide2 where it is assigned GetValue(). It should display its current value (7).
    Position the mouse on SSSSide3 where it is assigned GetValue(). It should display 0.
    Position the mouse on SSSSide1, on SSSSide2, then on SSSSide3 where they are accessed in the parentheses of Calculate(). They should display their current values (5, 7, and 0)
  19. To continue debugging, on the Debug toolbar, click the Step Into button Step Into.
    Notice that the "double GetValue(string identity, string msg)" function is accessed again.
    Notice the expressions on the right side of "double GetValue(string identity, string msg)".
    Check the values in the Locals window
  20. To continue debugging, on the Debug toolbar, click the Step Into button Step Into a few times (five times) until focus moves to the DOS window
  21. When the SSS Side 7 value is requested, type 10 and press Enter.
    Notice the value on the right side of "double GetValue(string identity, string msg)".
    Notice the ToDouble Returned expression and its value.
    Notice the values in the Locals window:

    Debugging - Breakpoint - Stepping Into ...

  22. To continue debugging, on the Debug toolbar, click the Step Into button Step Into twice.
    Notice the value on the right side of the closing curly bracket of the function (10)
  23. To continue debugging, on the main menu of Microsoft Visual Studio, click Debug and click Step Into.
    Notice thhat the debugging focus moves to the "SSSSide2 = GetValue()" function call
  24. To continue debugging, on the main menu of Microsoft Visual Studio, click Debug and click Step Into.
    Notice that the debugging focus moves to the "(double SSSAngle1, double SSSAngle2, double SSSAngle3) results = Calculate(TriangleType.SideSideSide, SSSSide1, SSSSide2, SSSSide3);" line.
    Notice the values in the Locals window:

    Debugging - Breakpoint - Stepping Into ...

    In the Code Editor, position the mouse on SSSSide1 = 0.00 where the variable is declared. Its current value should appear (5).
    Position the mouse on SSSSide2 = 0.00 where the variable is declared. Its current value should appear (7).
    Position the mouse on SSSSide3 = 0.00 where the variable is declared to see its current value (10).
    Position the mouse on SSSSide1 where it is assigned GetValue(). It should display its current value (5).
    Position the mouse on SSSSide2 where it is assigned GetValue(). It should display its current value (7).
    Position the mouse on SSSSide3 where it is assigned GetValue(). It should display 10.
    Position the mouse on SSSSide1, on SSSSide2, then on SSSSide3 where they are accessed in the parentheses of Calculate(). They should display their current values (5, 7, and 10).
    Position the mouse on results.SSSAngle1, on results.SSSAngle2, then on results.SSSAngle3. They should display 0 each
  25. To continue debugging, on the main menu of Microsoft Visual Studio, click Debug and click Step Into.
    Notice that the debugging focus moves to the "(double first, double second, double third) Calculate(TriangleType category, double known1, double known2, double known3)" function.
    Notice the expressions on the right side of the function.
    Notice the values in the Locals window
  26. To continue debugging, on the Debug toolbar, click the Step Into button Step Into.
    Notice the Acos Returned expression and its value
  27. To continue debugging, on the Debug toolbar, click the Step Into button Step Into.
    Notice the Acos Returned expression and its value
  28. To continue debugging, on the Debug toolbar, click the Step Into button Step Into twice.
    Notice the values on the closing curly bracket of the function
  29. To continue debugging, on the main menu of Microsoft Visual Studio, click Debug and click Step Into.
    Notice that the debugging focus moves to the "(double SSSAngle1, double SSSAngle2, double SSSAngle3) results = Calculate(TriangleType.SideSideSide, SSSSide1, SSSSide2, SSSSide3);" function call
  30. To continue debugging, on the Debug toolbar, click the Step Into button Step Into a few times (5 times) until the second breakpoint is accessed (on CalculateSSS();).
    Every time you click, following the debugging in the Code Editor and observe the lines in the DOS window
  31. To continue debugging, on the Debug toolbar, click the Step Into button Step Into a few times (three times) until the DOS window displays the final lines:
    ======================================================================
    This application allows you to make calculations on oblique triangles
    ======================================================================
    Available shape options:
    1 - AAS (Known: Angle - Angle - Side)
    2 - ASA (Known: Angle - Side  - Angle)
    3 - SAS (Known: Side  - Angle - Side)
    4 - SSS (Known: Side  - Side  - Side)
    Q - Quit
    What type of triangle do you want to process? 4
    SSS Shape
    ----------------------------------------------------------------------
    Known Values:  All 3 sides
    Sought Values: All 3 angles
    ----------------------------------------------------------------------
    Type the known values
    SSS Side 1:  5
    SSS Side 2:  7
    SSS Side 3:  10
    ======================================================================
    Results
    ----------------------------------------------------------------------
    SSS Angle 1: 27.66044989930087
    SSS Angle 2: 40.53580211131656
    SSS Angle 3: 111.80374798938257
    ======================================================================
    
    Press any key to close this window . . .
  32. In the DOS window, press Z to close the window and return to your programming environment
  33. To remove all breakpoints, on the main menu of Microsoft Visual Studio, click Debug -> Delete All Breakpoints
  34. Read the message box that appears and click Yes

Previous Copyright © 2010-2026, FunctionX Monday 13 July 2026, 12:29 Next