Assignment #5

Due: Thurs, June 26

Objective

This assignment will involve practice with characters and strings, using the libraries discussed in class (String, StringBuilder, Character)

Task

Write the following exercises, each in a separate file. Filenames should be:

Exercise 1

Filename: Password.java

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.java

Write a method, 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 the files through the Assignment 5 Blackboard link. Make sure you attach BOTH files before you click Submit:
  Password.java
  PigLatin.java