diff options
| author | Anibal LopezBonilla <[email protected]> | 2022-10-04 13:57:50 -0700 |
|---|---|---|
| committer | Anibal LopezBonilla <[email protected]> | 2022-10-04 13:57:50 -0700 |
| commit | 42e1d90416aae4fc9cc0a9b847bf285bb92f2721 (patch) | |
| tree | afc4c76d033544f3583629eae26a9d3cb167cc81 /CST116-Ch5-Debugging | |
| parent | Comment (diff) | |
| download | cst116-ch5-debugging-buzzerbeaterclutch-42e1d90416aae4fc9cc0a9b847bf285bb92f2721.tar.xz cst116-ch5-debugging-buzzerbeaterclutch-42e1d90416aae4fc9cc0a9b847bf285bb92f2721.zip | |
Small details
Diffstat (limited to 'CST116-Ch5-Debugging')
| -rw-r--r-- | CST116-Ch5-Debugging/CST116-Ch5-Lopez-Bonilla.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/CST116-Ch5-Debugging/CST116-Ch5-Lopez-Bonilla.cpp b/CST116-Ch5-Debugging/CST116-Ch5-Lopez-Bonilla.cpp index b2f8c06..38a6c87 100644 --- a/CST116-Ch5-Debugging/CST116-Ch5-Lopez-Bonilla.cpp +++ b/CST116-Ch5-Debugging/CST116-Ch5-Lopez-Bonilla.cpp @@ -46,7 +46,7 @@ * * Correct Code * raise = money * raise; -* money = money + raise +* money = money + raise; * * Debugging Exercise 3 * @@ -69,19 +69,24 @@ using std::endl; int main() { + //Money and raise variable is introduced float money = 123.45F; float raise; + //User is informed of the current amount of money. cout << "You have $"; cout << money << endl; // Breakpoint 1 // Put a breakpoint on the following line + + //User inputs the percentage raise cout << "Enter percent raise: "; cin >> raise; - money = money * raise; - + //money = money * raise; + raise = money * raise; + money = money + raise; cout << "After your raise you have $"; cout << money << endl; |