home *** CD-ROM | disk | FTP | other *** search
/ Beginning C++ Through Gam…rogramming (2nd Edition) / BCGP2E.ISO / source / chapter02 / score_rater2.cpp < prev   
Encoding:
C/C++ Source or Header  |  2003-10-21  |  336 b   |  21 lines

  1. // Score Rater 2.0
  2. // Demonstrates an else clause
  3.  
  4. #include <iostream>
  5. using namespace std;
  6.  
  7. int main() 
  8. {
  9.     int score;
  10.     cout << "Enter your score: ";
  11.     cin >> score;
  12.  
  13.     if (score > 500)
  14.         cout << "\nYou got over 500. Nice score.\n";
  15.     else
  16.         cout << "\nYou got 500 or less. Nothing to brag about.\n";
  17.  
  18.     return 0;
  19. }
  20.  
  21.