Name: ____________________________________________________ Alpha: _____________________

Describe help received: _________________________________________________________________

  1. [20pts] Rewrite the following code fragment so that a while loop is used instead of the for statement.

    for( int i = 100; i > 0; i-- )
    	cout << i << endl;
  2. [80pts] Many organizations have password policies that try to encourage people to choose good passwords. That means being able to check whether a given password satisfies the policy requirements. Your job is a write a program that reads in a password and determines whether it meets the following requirements:
    A password must contain at least two upper case letters, at least two lower case letters, at least two digits and at least two "other" symbols, i.e. ones that don't fit the other categories.
    You may assume that passwords never contain the character \, and so the password the user enters will end with a \, which is not part of the password, but which indicates the end of the password. Here are some sample runs:
    ~/$ ./checker
    ~/$ ./checker
  3. Note: You can freely use either a while-loop or for-loop.
Turn in a printout of this cover sheet with your source code, and a screen capture of your program running on the passwords fo$t3Rt@t3R and Cr@8sT@steGre@t