0% found this document useful (0 votes)
30 views

Exercise 2 - Password Generation

The program asks the user to enter their full name and converts it to uppercase before displaying a greeting message. It then prompts the user to enter a password, converts it to lowercase and removes whitespace before validating that the password is exactly 8 characters with no numbers or spaces, displaying an error if invalid.

Uploaded by

Judith Nelson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Exercise 2 - Password Generation

The program asks the user to enter their full name and converts it to uppercase before displaying a greeting message. It then prompts the user to enter a password, converts it to lowercase and removes whitespace before validating that the password is exactly 8 characters with no numbers or spaces, displaying an error if invalid.

Uploaded by

Judith Nelson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Exercise 2

Write a program that will ask a user to enter their full name e.g. “Sally Susanson”

 Convert the full name uppercase


 Display a message to say “Hello SALLY SUSANSON”

Ask the user to enter a new password

 Convert the password to lowercase


 Remove any white space to the left or right of the password characters

Perform these validation checks:

 Passwords must be exactly 8 characters long


 Passwords cannot contain any numbers
 Passwords cannot contain spaces

Display an error message if the password doesn’t meet any of the above criteria

You might also like