1. // age.cpp
 2. //
 3. // This program does not work!  Can you find the errors?
 4. // (Thanks to Fall 2001 CS 111 tutor Cheuk Yip for writing first draft.)
 5. 
 6. #include<iostream>
 7. 
 8. using namespace std;
 9. 
10. int main()
11. {
12.    cout << "Please enter your age:>";
13. 
14.    int age;
15.    cin >> age;
16. 
17.    if ( age < 0 )
18.       cout << "You are not even born yet." << endl;
19.    else if ( age >= 18)  {
20.       if(age > 64)
21.          cout << "You are a senior adult." << endl;
22.       else
23.          cout << "You are an adult."<<endl;
24.       cout << "You are old enough to vote."<< endl;
25.    } else
26.       if(age <= 12)
27.          cout<< "You are a child." << endl;
28.       else
29.          cout << "You are a teenager." << endl;
30.       cout << "You are too young to vote."<< endl;
31.    return 0;
32. }  // function main