This is Ruby language problem Directions: Please complete the following assignme
ID: 3681776 • Letter: T
Question
This is Ruby language problem
Directions:
Please complete the following assignment to signify your completion of Unit 6. All programming projects need to be completed and submitted electronically, following the Electronic Submission Guidelines discussed in class.
Background:
The purpose of this assignment is to get practice working with textual data. In Ruby, string is a class and comes with many different operations we can perform on it. The programming project below will ask you to learn some of these new capabilities.
Project 1: Username/Password Validator
Create a Ruby program which prompts for a username and password and validates that they meet the following criteria:
The username should:
- have at least 8 characters long
- contain alpha numeric characters (no spaces or special characters)
- contain at least 1 uppercase character
- contain at least 1 lowercase character
- contain at least 1 numeric character (0-9)
The password should:
- not contain a user’s username (i.e. the username “CraigKapp1 is valid, but the password “CraigKapp1Password” is not valid because it contains the string “CraigKapp1)
- be at least 8 characters long
- only contain alpha numeric characters (no spaces or special characters)
- contain at least 1 uppercase character
- contain at least 1 lowercase character
- contain at least 1 numeric character (0-9)
A number of different program dialogues describe the program I am looking for.
CS223 Username/Password Validator
Username: Corsair1
Password: GoDodgers1
The Username/Password combination is valid!
CS223 Username/Password Validator
Username: Corsair
Password: GoDodgers1
The Username requires numeric character
CS223 Username/Password Validator
Username: corsair1
Password: GoDodgers1
The Username requires an uppercase character
CS223 Username/Password Validator
Username: CORSAIR1
Password: GoDodgers1
The Username requires an lowercase character
CS223 Username/Password Validator
Username: corsair
Password: GoDodgers1
The Username requires atleast 8 letters
CS223 Username/Password Validator
Username: Corsair1
Password: aaCorsair1aa
The Password cannot contain the Username
CS223 Username/Password Validator
Username: Corsair1
Password: gododgers1
The Password requires an uppercase character
CS223 Username/Password Validator
Username: Corsair1
Password: GODODGERS1
The Password requires an lowercase character
CS223 Username/Password Validator
Username: Corsair1
Password: 1
The Password requires atleast 8 letters
Explanation / Answer
STDOUT.sync = true # initializing constant and assigning value to it $MIN_LENGTH = 8 # Helper method, which returns true if string satisfies the mentioned # in the assignment criteria and false otherwise. def string_validator(string, parameter) if string.lengthRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.