Write a C++ program to validate the user's password which should contain the following constraints. Use Custom exception handling mechanisms to validate the password. Problem Constraints: The password should contain at least 10 characters. Then it should contain at least one digit, one uppercase, and one lowercase (Eg.Student123) Create class User with following private member variables Data Type string string char* Variables name username password Include appropriate constructors, getters, and setters for the User class Create class UserBO with following member function Function Name int validatePassword(char password[],int length) int validatePassword(char password[],int length) Description Create class WeakPasswordException which inherits exception Function Name Description This function returns the custom exception "WeakPasswordException: password should contain at least 10 characters" virtual const char* what() const throw() In the main method, if all the constraints are satisfied, then print the User details with the string "!!!Strong password!!!" and "User details:" else print "!!!Weak password!!!" Input and Output format: Refer sample Input and Output for formatting specifications. [All text in bold corresponds to input and the rest corresponds to output] Sample Input and Output 1: Enter the name: Induja C Enter the username: Induja Chinnasamy Enter your password: Indujac123 !!!Strong password!!! User details: Name: Induja C Username: Induja Chinnasamy Password:In******** Sample Input and Output 2: Enter the name: Binny Enter the username: Binny Chelziah Enter your password: 1234567890 WeakPasswordException:password should contain at least 10 characters !!!Weak password!!! Sample Input and Output 3: Enter the name: Indu Enter the username: Induja Enter your password: Induc WeakPasswordException:password should contain at least 10 characters !!!Weak password!!!

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

1:- QUESTION ATTACHED KINDLY SEE. MATCH OUTPUT AND INPUT AS IT IS.

2:- AND TEMPLATE PROVIDE BELOW USE IT WHILE MAKING SOLUTION.

 

---------------TEMPLATES---------------------

MAIN.CPP

#include<iostream>
#include <cstring>
#include "User.cpp"
#include "UserBO.cpp"
using namespace std;
int main()
{

//Fill your code here
return 0;
}

 

WeakPasswordException.cpp

#include <iostream>
#include <exception>
using namespace std;
class WeakPasswordException: public exception
{
//Fill your code here

};

 

UserBO.cpp

#include "WeakPasswordException.cpp"
#include "User.cpp"
class UserBO
{
//Fill your code here

};

 

User.cpp

#ifndef HEADER
#define HEADER
#include <iostream>
using namespace std;
class User
{
//Fill your code here

};
#endif
Write a C++ program to validate the user's password which should contain the following constraints.
Use Custom exception handling mechanisms to validate the password.
Problem Constraints:
The password should contain at least 10 characters.
Then it should contain at least one digit, one uppercase, and one lowercase (Eg.Student123)
Create class User with following private member variables
Data Type
string
string
char*
Variables
name
username
password
Include appropriate constructors, getters, and setters for the User class
Create class UserBO with following member function
Function Name
int validatePassword(char password[],int length) int validatePassword(char password[],int length)
Description
Create class WeakPasswordException which inherits exception
Function Name
Description
This function returns the custom exception
"WeakPasswordException: password should contain at least 10 characters"
virtual const char" what() const throw()
In the main method, if all the constraints are satisfied, then print the User details with the string
"!!!Strong password!!!" and "User details:" else print "!!!Weak password!!!"
Input and Output format:
Refer sample Input and Output for formatting specifications.
[All text in bold corresponds to input and the rest corresponds to output]
Sample Input and Output 1:
Enter the name:
Induja C
Enter the username:
Induja Chinnasamy
Enter your password:
Indujac123
!!!Strong password!!!
User details:
Name: Induja C
Username: Induja Chinnasamy
Password:In********
Sample Input and Output 2:
Enter the name:
Binny
Enter the username:
Binny Chelziah
Enter your password:
1234567890
WeakPasswordException:password should contain at least 10 characters
!!!Weak password!!!
Sample Input and Output 3:
Enter the name:
Indu
Enter the username:
Induja
Enter your password:
Induc
WeakPasswordException:password should contain at least 10 characters
!!!Weak password!!!
Transcribed Image Text:Write a C++ program to validate the user's password which should contain the following constraints. Use Custom exception handling mechanisms to validate the password. Problem Constraints: The password should contain at least 10 characters. Then it should contain at least one digit, one uppercase, and one lowercase (Eg.Student123) Create class User with following private member variables Data Type string string char* Variables name username password Include appropriate constructors, getters, and setters for the User class Create class UserBO with following member function Function Name int validatePassword(char password[],int length) int validatePassword(char password[],int length) Description Create class WeakPasswordException which inherits exception Function Name Description This function returns the custom exception "WeakPasswordException: password should contain at least 10 characters" virtual const char" what() const throw() In the main method, if all the constraints are satisfied, then print the User details with the string "!!!Strong password!!!" and "User details:" else print "!!!Weak password!!!" Input and Output format: Refer sample Input and Output for formatting specifications. [All text in bold corresponds to input and the rest corresponds to output] Sample Input and Output 1: Enter the name: Induja C Enter the username: Induja Chinnasamy Enter your password: Indujac123 !!!Strong password!!! User details: Name: Induja C Username: Induja Chinnasamy Password:In******** Sample Input and Output 2: Enter the name: Binny Enter the username: Binny Chelziah Enter your password: 1234567890 WeakPasswordException:password should contain at least 10 characters !!!Weak password!!! Sample Input and Output 3: Enter the name: Indu Enter the username: Induja Enter your password: Induc WeakPasswordException:password should contain at least 10 characters !!!Weak password!!!
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY