| 1 | // File: fig0604.cpp |
| 2 | // Computer Systems, Fourth Edition |
| 3 | // Figure 6.4 |
| 4 | |
| 5 | #include <iostream> |
| 6 | using namespace std; |
| 7 | |
| 8 | int main () { |
| 9 | const int bonus = 5; |
| 10 | int exam1; |
| 11 | int exam2; |
| 12 | int score; |
| 13 | cin >> exam1 >> exam2; |
| 14 | score = (exam1 + exam2) / 2 + bonus; |
| 15 | cout << "score = " << score << endl; |
| 16 | return 0; |
| 17 | } |