Question: It is C++ assignment, the assignment is the picture. just add exception class (PasswordError class) in my following lab that i already wrote! // Prior
It is C++ assignment, the assignment is the picture. just add exception class (PasswordError class) in my following lab that i already wrote!// Prior Lab #include #include #include #include using namespace std; int countNumeric(char password[100]) { int i, count = 0; for (i = 0; i password); i++) { if (isdigit(password[i])) count++; } return count; } int countUpperCase(char password[100]) { int i, count = 0; for (i = 0; i Password Exceptions In a prior lab, you input passwords and tested them against these criteria: 1) 2) 3) 4) At least eight characters long Contains at least one numeric digit Contains at least one upper case and at least one lower case letter Contains one of these special characters: Each criterion was tested in a separate test function. Write a PasswordError class that describes password errors. Extend your password program to manage password errors with try-throw-catch statements In each function, construct and throw a PasswordError object containing the password and error In the main program, catch exceptions and display a message describing the password and error Be sure your program discovers and reports all errors present in each password
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock

// Prior Lab #include #include #include #include using namespace std; int countNumeric(char password[100]) { int i, count = 0; for (i = 0; i password); i++) { if (isdigit(password[i])) count++; } return count; } int countUpperCase(char password[100]) { int i, count = 0; for (i = 0; i Password Exceptions In a prior lab, you input passwords and tested them against these criteria: 1) 2) 3) 4) At least eight characters long Contains at least one numeric digit Contains at least one upper case and at least one lower case letter Contains one of these special characters: Each criterion was tested in a separate test function. Write a PasswordError class that describes password errors. Extend your password program to manage password errors with try-throw-catch statements In each function, construct and throw a PasswordError object containing the password and error In the main program, catch exceptions and display a message describing the password and error Be sure your program discovers and reports all errors present in each password