Assignment #7

Due: Wed, Nov 30

Objective

This assignment will involve practice with string objects, using the string class library

Task

Write the following exercises, each in a separate file. Filenames should be: (Note that the filenames are all lowercase)

Exercise 1

Filename: password.cpp

This is based on programming challenge 12 in chapter 10 of the textbook

Many computer systems, web sites, etc. allow user accounts with passwords. When allowing users to choose passwords, many systems have requirements regarding the strength of the chosen password.

Write a program that allows a user to choose a password. The password is to be a single string of characters that contains no white space.

Sample Run

(user input is underlined, to distinguish it from output)
Enter your password: mommy1
Password needs to contain at least one uppercase letter

Enter your password: Mom2
Password needs to have 6 or more characters

Enter your password: dad
Password needs to have 6 or more characters
Password needs to contain at least one uppercase letter
Password needs to contain at least one digit

Enter your password: MYNAME4
Password needs to contain at least one lowercase letter

Enter your password: Friend8
Now re-enter your password for verification: Friend
Password does not match.  Start over

Enter your password: ClamChowder66
Now re-enter your password for verification: ClamChowder66

You have now entered a valid password

Exercise 2

Filename: piglatin.cpp

Write a function, called ToPigLatin, which is described below:

Sample Runs

(user input is underlined, to distinguish it from output)

Sample Run 1

Input 5 words: Flower yellow bypass apple Igloo

Pig Latin version of the 5 words:
Owerflay ellowyay ypassbay appleway Iglooway

Sample Run 2

Input 5 words: string Hamburger Rhythm queen zippitydoodah

Pig Latin version of the 5 words:
ingstray Amburgerhay Ythmrhay ueenqay ippitydoodahzay

Requirements for both programs


Submitting:

Submit only your source code files through the web submission page. This will consist of the following files:
  password.cpp
  piglatin.cpp