Question: Write a function named testPassword that takes string as a paramenter. Define this function to test if the string contains characters such as # ?

Write a function named testPassword that takes string as a paramenter. Define this function to test if the string contains characters such as "#" "?" and "@." If it contains any of these then throw the string containing these 3 characters.

Part 2: write a main code where you use the try and catch format to check if password contains these characters. If so then print "error invalid characters" using cout statement.

***Please do it in C++***

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!