aboutsummaryrefslogtreecommitdiff
path: root/main.cpp
blob: 844b5575f141bfd6cca85b1448de4146dc7e2035 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//
//  main.cpp
//  CST116-ch.5 debugging-Davis
//
//  Levi Davis
//

// 1) On the lines indicated in the code below, insert a breakpoint.
// 2) With the program not in debugging mode, start debugging by
//    using the "Step Into" tool.
// 3) Click on the Watch1 tab.
// 4) With the cursor in the Name column type money and press enter.
//   This adds a programmer defined watch on the variable money.
// 5) Step Into until you reach the first cout statement. With
//    the current line being that cout statement, Step Into again.
// 6) What happened? Where are we now? What is all of this nasty
//    looking code?
// 7) Remember, stepping into a predefined routine takes you to the
//    code for that routine. If the debugger can't find the code it
//    will show the assembly code for that routine.
// 8) How do we get out of this mess? Use the "Step Out" tool.
// 9) In Visual Studio you will be taken back to the same cout
//    statement. Use the Step Over tool to take you to the next
//    line.
// 10) Step over the next cout statement. Now look at the console
//     window. What was printed?
// 11) Select Stop Debugging either from the Debug menu or from your
//     toolbar.
#include <iostream>
#include <iomanip>
using std::cout;
using std::cin;
using std::endl;

int main()
{
    float money = 123.45F;
    float raise;

    cout << "You have $";
    cout << money << endl;


    cout << "Enter percent raise: ";
    cin >> raise;

    money = money * raise;

    cout << "After your raise you have $";
    cout << money << endl;

    return 0;
}