subject

Create an application that will check for valid passwords. The following rules must be followed to create a valid password. 1. At least 8 characters long
2. At least 1 numeric character
3. At least 1 uppercase alphabetic character
4. At least 1 lowercase alphabetic character
5. No more than 2 of the same character in a sequence Hello123 – OK AAAbb123 – not OK Aaabb123 – OK
Operation: When the application begins, the user will be presented with a screen that states the above instructions for creating a password, two text entry boxes for typing in a password, and three buttons.
If the user wants to check a single password, they will type in the password in both boxes and select the "Check Password" button.
If the user wants to read in and check a list of passwords, they will select the "Check Passwords in File" button, be presented with a file explorer, and select the file to read from. Those passwords that failed the check will be displayed, with their error message. If the user presses the "Alt" key, a letter will be underlined in each button label. That letter is the "mnemonic" that can used as a shortcut (Alt plus the letter) to execute the button.
If the user hovers his cursor over a button, a tooltip will be shown.
Specifications: The Data Element String
The Data Structure ArrayList of Strings
The Data Manager Create a PasswordChecker class that implements PasswordCheckerInterface. The PasswordChecker class will have at least two methods: One method that checks the validity of one password that returns true if the password is valid and that throws an exception if invalid. One that checks an ArrayList of passwords and returns an ArrayList with the status of any invalid passwords. The ArrayList of invalid passwords will be of the following format: Create exception classes for each exception listed in PasswordCheckerInterface. java. Always check for the length of the password first, since that is the easiest and fastest check. Once the password fails one rule, you do not need to check the rest of the rules.
The GUI
• Provide buttons to allow user to check validity of one password or a file of passwords.
• Ask the user to enter the password and to re-type the password. If the two are not the same, inform the user.
• Create a tool tip and a mnemonic for each of the buttons.
• Use a FileChooser for the user to select the input file.
• Use methods of PasswordChecker to process the passwords.
• Use try/catch structure to catch exceptions thrown by PasswordChecker methods
Exceptions
Provide exception classes for the following:
1. Length of password is less than 8 characters (class LengthException) Message – The password must be at least 8 characters long
2. Password doesn’t contain an uppercase alpha character (class NoUpperAlphaException) Message – The password must contain at least one uppercase alphabetic character
3. Password doesn’t contain a lowercase alpha character (class NoLowerAlphaException) Message – The password must contain at least one lowercase alphabetic character
4. Password doesn’t contain a numeric character (class NoDigitException) Message – The password must contain at least one digit
5. Password contains more than 2 of the same character in sequence (class InvalidSequenceException) Message – The password cannot contain more than two of the same character in sequence.
6. For GUI – check if Password and re-typed Password are identical (class UnmatchedExcpetion) Message – The passwords do not match
import java. util. ArrayList;
public interface PasswordCheckerInterface {
public boolean isValidPassword (String passwordString) throws LengthException, NoDigitException, NoUpperAlphaException, NoLowerAlphaException, InvalidSequenceException;
public ArrayList validPasswords (ArrayList passwords);}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 15:10
What is word processing and word wrap?
Answers: 1
question
Computers and Technology, 21.06.2019 22:00
Matlab question: use switch and anythe lottery game matches three different integer numbers between 1 and 10. winning depends on how many matching numbers are provided by a player. the player provides three different integers between 1 and 10.if there is a match of all 3 numbers, the winning $ 1000.if there is a match with 2 numbers, the winning $ 10.if there is a match of all with 1 numbers, the winning $ 1.with no match, the winning is $0.write a function lottery3 that checks three numbers provided by a player and determine the winning amount. if the user mistakenly enters same number twice/thrice and if that number matches one of the winning numbers, the code should count that number only once and display correct result. the player doesn’t have to guess the order of numbers.the input to the function lottery3 can have up to two input arguments. the first input argument is a row array numbers with 3 numbers. if the second argument input testcode is present, and is a row vector of 3 values, the function lottery3 uses the code in testcode as the three winning numbers (the test must be three different integer numbers between 1 and 10), else three different numbers will be automatically generated by testcode.the ouput should return the variable winnings and the three winning numbers in the row array winnumbers.hint: make use of the internal function any.restriction: the function must use switch-case statements to determine the winning.example #1: winning = lottery3( [1,2,1],[1,2,3])produceswinning =10example #2: [winning,winnumbers] = lottery3( [1,2,3])produceswinning =3winnumbers =8 5 3
Answers: 1
question
Computers and Technology, 21.06.2019 22:00
What must you do before formatting a paragraph?
Answers: 1
question
Computers and Technology, 22.06.2019 13:10
Calculating the "total price" of an item is tedious, so implement a get_item_cost method that just returns the quantity times the price for an item. by the way, the technical term for this kind of instance method is an accessor method, but you'll hear developers calling them getters because they always start with "get" and they get some value from instance attributes. in order to make the items sortable by their total total price, we need to customize our class. search the lectures slides for "magic" to see how to do this. see section 9.8 for an additional reference. the receipt class: this will be the class that defines our receipt type. obviously, a receipt will consist of the items on the receipt. this is called the composition design pattern. and it is very powerful. instance attributes: customer_name : it is very important to always know everything you can about your customers for "analytics", so you will keep track of a string customer name in objects of type receipt. date : the legal team has required that you keep track of the dates that purchases happen for "legal reasons", so you will also keep track of the string date in objects of type receipt. cart_items : this will be a list of the items in the cart and hence end up on the receipt. methods: 1. create a default constructor that can take a customer name as an argument, but if it gets no customer name, it will just put "real human" for the customer_name attribute. it should also accept a date argument, but will just use the value "today" for the date instance attribute if no date is given. the parameters should be named the same as the instance attributes to keep things simple. 2. add_item : self-descriptive. takes a parameter which we hope beyond hope is of type itemtopurchase and adds it to the cart_items. returns none. 3. print_receipt : takes a single parameter isevil, with default value true. returns a total cost of all the items on the receipt (remember to factor in the quantity). prints the receipt based on the following specification: for example, if isevil is true, and customer_name and date are the default values: welcome to evilmart, real human today have an evil day! otherwise, it should print: welcome to goodgo, real human today have an good day! then the receipt should be printed in sorted order like we discussed earlier, but whether or not it starts with the highest cost (think reverse), depends on the value of isevil. if it is evil, then the lowest cost items should print first, but if it is good, then it will print the highest cost items first. (cost meaning price*quantity). remember to return the total cost regardless! your main() function: the main flow of control of your program should go in a main() function or the program will fail all the unit tests. get the name of the customer with the prompt: enter customer name: get the date with the prompt: enter today's date then, ask the question: are you evil? your program should consider the following as true: yeah yup let's face it: yes hint: what do these strings all have in common? your program should consider all the following as false: no nah perhaps but i'm leaning no (just be glad you don't have to handle "yeah no.") okay enough horsing around. (get it? aggies? ! horsing! ) next, in the main() function, you will have to create a receipt object and start adding things into it using an input-while loop. the loop will prompt the user for the item name exactly as in the previous zylab (9.11). but unlike the previous zylab, the loop will terminate only if an empty string is entered for the item name. then, the price and the quantity will be prompted for exactly as in the previous zylab. create the itemtopurchase objects in the same manner as the previous zylab, but don't forget to add them to the receipt using your add_item instance method. then, the items on the receipt should be printed with the same formatting as in the previous zylab, of course with either "good" or "evil" ordering. however, on the last line, the total should be printed as follows: where 10 is replaced by the actual total. sample run here is what a sample run of the final program should look like: enter customer name: nate enter today's date: 12/20/2019 are you evil? bwahahahaha yes enter the item name: bottled student tears enter the item price: 2 enter the item quantity: 299 enter the item name: salt enter the item price: 2 enter the item quantity: 1 enter the item name: welcome to evilmart, nate 12/20/2019 have an evil day! salt 1 @ $2 = $2 bottled student tears 299 @ $2 = $598 total: $600
Answers: 1
You know the right answer?
Create an application that will check for valid passwords. The following rules must be followed to c...
Questions
Questions on the website: 13722360