Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++: This programming lab makes use of an array of characters. The program will validate the characters in the array to see if they meets

C++:

This programming lab makes use of an array of characters. The program will validate the characters in the array to see if they meets a set of requirements.

Requirements:

Must be at least 6 characters long (but not limited to 6, can be greater)

Contains one upper case letter

Contains one lower case letter

Contains one digit

Complete the code attached. Must use pointer while checking the characters.

 #include  using namespace std; // Global constants const int SIZE = 80; // The maximum size of the array const int MIN = 6; // The minimum number characters // Function prototypes void displayRequirements(); void displayResult(char[]); int main() { char cstring[SIZE]; displayRequirements(); cout << "Enter a password: "; cin.getline(cstring, SIZE); displayResult(cstring); return 0; } void displayRequirements() { // Display the password requirements. cout << "Password Requirments: " << " - The password should be at least " << MIN << " characters long. " << " - The password should contain at least one uppercase " << " and at least one lowercase letter. " << " - The password should have at least one digit. "; } void displayResult(char str[]) { bool length, upper, lower, digit; length = upper = lower = digit = false; int lengthCount = 0; }

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

Students also viewed these Databases questions

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago