Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write a C++ program to check a password and print all the violations of a secure password. Please print Congratulations! Your password is very

Please write a C++ program to check a password and print all the violations of a secure password. Please print "Congratulations! Your password is very secure!" if there is no violation found for this password.

All the possible 10 violations are as follows:

  1. Your password is not secure since it has less than 2 upper-case letters.
  2. Your password is not secure since it has less than 2 lower-case letters.
  3. Your password is not secure since it has less than 7 characters.
  4. Your password is not secure since it has less than 2 digits.
  5. Your password is not secure since it has more than 12 characters.
  6. Your password is not secure since it contains space.
  7. Your password is not secure since it contains only digits.
  8. Your password is not secure since it contains only alphabets.
  9. Your password is not secure since it contains none of 6 special symbols: $ % @ ! ? *
  10. Your password is not secure since it contains 2020, 2019, 2018, or 2017.

You must test your program 3 times with outputs of 3 test cases shown on your report. The output of your test case #1 must look as follows:

Welcome to the program of "your name"

Please enter a password (Enter q to quit): a b

The password you just entered is a b

Your password is not secure since it has less than 2 upper-case letters.

Your password is not secure since it has less than 7 characters.

Your password is not secure since it contains space.

Your password is not secure since it has less than 2 digits.

Your password is not secure since it contains none of 6 special symbols: $ % @ ! ? *

Your password has the above 5 problems to be fixed.

Please enter a password (Enter q to quit): 2020

The password you just entered is 2020

Your password is not secure since it contains 2020, 2019, 2018, or 2017.

Your password is not secure since it has less than 2 lower-case letters.

Your password is not secure since it has less than 2 upper-case letters.

Your password is not secure since it has less than 7 characters.

Your password is not secure since it contains only digits.

Your password is not secure since it contains none of 6 special symbols: $ % @ ! ? *

Your password has the above 6 problems to be fixed.

Please enter a password (Enter q to quit): PW$2015ok

The password you just entered is PW$2015ok

Congratulations! Your password is very secure!

Please enter a password (Enter q to quit): MrLo1234

The password you just entered is MrLo1234

Your password is not secure since it contains none of 6 special symbols: $ % @ ! ? *

Your password has the above 1 problems to be fixed.

Please enter a password (Enter q to quit):

The password you just entered is

Your password is not secure since it has less than 2 lower-case letters.

Your password is not secure since it has less than 2 upper-case letters.

Your password is not secure since it has less than 7 characters.

Your password is not secure since it contains space.

Your password is not secure since it has less than 2 digits.

Your password is not secure since it contains none of 6 special symbols: $ % @ ! ? *

Your password has the above 6 problems to be fixed.

Please enter a password (Enter q to quit): Password123OK$

The password you just entered is Password123OK$

Your password is not secure since it has more than 12 characters.

Your password has the above 1 problems to be fixed.

Please enter a password (Enter q to quit): q

Thank you for playing this PASSWORD game. Hope to see you again!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Inference Control In Statistical Databases From Theory To Practice Lncs 2316

Authors: Josep Domingo-Ferrer

2002nd Edition

3540436146, 978-3540436140

More Books

Students also viewed these Databases questions