1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
aksik [14]
3 years ago
13

Write a program that asks for a password and then verifies that it meets the stated criteria. • If the password meets the criter

ia, it should state so. • If it doesn’t, the program should display a message telling the user why it failed. • Call your program: MyName-Hwrk10A.cpp . Be sure to put your name as a comment in the code as well as display it in the screen output. • Note, there is no need to give the user a second chance (or more) to type in a different password. The user should simply be told that the password was successful, or why it wasn’t, and then the program can end.
Computers and Technology
1 answer:
inessss [21]3 years ago
4 0

Missing Details in Question

The password criteria are not stated. For this program, I'll assume the following

  • Password must contain at least 1 capital letter
  • Password must contain at least 1 small letter
  • Password must contain at least 1 digit
  • Password must be at least 8 characters

See Attachment for Source File "MyName-Hwrk10A.cpp"

Answer:

// Comment explains difficult lines

#include<iostream>

#include<cstring>

#include<cctype>

using namespace std;

int main()

{

//Enter your name here

int k,l,m;

/*

Integer variables k,l and m are used to count the number of  

capital letters small letters and digits in the input string (password)

*/

//Initialize them to 0

k=0;l=0;m=0;

int length;

string pass;

cout<<"Password: ";

cin>>pass;

//Calculate length of input string

length = pass.length();

//The following variable is declared to determine if the input string meets criteria

int det = 0;

for(int i = 0;i<pass.length();i++)

{

 if(isupper(pass[i])){ k++;}

 if(islower(pass[i])){ l++;}

 if(isdigit(pass[i])){ m++;}    

}

if(k==0)

{

cout<<"Password doesn't contain capital letters "<<endl;

det++;

}

if(l==0)

{

cout<<"Password doesn't contain small letters "<<endl;

det++;

}

if(m==0)

{

cout<<"Password doesn't contain digit "<<endl;

det++;

}

if(length<8)

{

cout<<"Length of password is less than 8 "<<endl;

det++;

}

if(det == 0)

{

 cout<<"Password meets requirements "<<endl;

}    

 return 0;

}

Download cpp
You might be interested in
Which of the following does Moore's law predict?
Korolek [52]

Answer:

Hi!

The correct answer is the a.

Explanation:

The Moore's law is an a empirical law that Gordon Moore predicted doing some observations about how the density of the transistors on a integrated circuit was increasing over time.

For example, this law state that if you have an integrated circuit with: 1000 transistors in 1980 then in 1981 and six months later you will have the same integrated circuit with 2000 transistors, and so on..

  • Jan 1980: 1000 transistors.
  • Jul 1981: 2000 transistors.
  • Jan 1983: 4000 transistors.
  • Jul 1984: 8000 transistors.

And that's the reason because its cost will fall too.

7 0
3 years ago
Trisha's computer kept rebooting frequently. Therefore, she decided to call customer support. When he was checking the computer,
harkovskaia [24]
Answer: F10 or delete key. when you click these keys they usually will take you to the bios to look over the computers system to make sure that everything is working properly.
7 0
3 years ago
I know this is complicated, but for all our coders here, can you please detect what is wrong with my batch file rpg? On the FIGH
Dennis_Churaev [7]
I can maybe look this up then message you via brainly I'm not to shabby with coding brb
3 0
3 years ago
Read 2 more answers
What are the different parameters for the shape functions
Ugo [173]
In probability theory and statistics, a shape parameter is a kind of numerical parameter of a parametric family of probability distributions.[1]

Specifically, a shape parameter is any parameter of a probability distribution that is neither a location parameter nor a scale parameter (nor a function of either or both of these only, such as a rate parameter). Such a parameter must affect the shape of a distribution rather than simply shifting it (as a location parameter does) or stretching/shrinking it (as a scale parameter does).

Contents
Estimation Edit

Many estimators measure location or scale; however, estimators for shape parameters also exist. Most simply, they can be estimated in terms of the higher moments, using the method of moments, as in the skewness (3rd moment) or kurtosis (4th moment), if the higher moments are defined and finite. Estimators of shape often involve higher-order statistics (non-linear functions of the data), as in the higher moments, but linear estimators also exist, such as the L-moments. Maximum likelihood estimation can also be used.

Examples Edit

The following continuous probability distributions have a shape parameter:

Beta distribution
Burr distribution
Erlang distribution
ExGaussian distribution
Exponential power distribution
Fréchet distribution
Gamma distribution
Generalized extreme value distribution
Log-logistic distribution
Inverse-gamma distribution
Inverse Gaussian distribution
Pareto distribution
Pearson distribution
Skew normal distribution
Lognormal distribution
Student's t-distribution
Tukey lambda distribution
Weibull distribution
Mukherjee-Islam distribution
By contrast, the following continuous distributions do not have a shape parameter, so their shape is fixed and only their location or their scale or both can change. It follows that (where they exist) the skewness and kurtosis of these distribution are constants, as skewness and kurtosis are independent of location and scale parameters.

Exponential distribution
Cauchy distribution
Logistic distribution
Normal distribution
Raised cosine distribution
Uniform distribution
Wigner semicircle distribution
See also Edit

Skewness
Kurtosis
Location parameter
4 0
4 years ago
If a database named Contacts has a table named tblEmployees and another database named Orders links to that tblEmployees table,
Vlad1618 [11]

Answer:

cache I think

Explanation:

I am not sure or memory HDD or SSD

5 0
3 years ago
Other questions:
  • On which tab can you find the margins button
    14·2 answers
  • A. True <br> b. False: variables represent storage locations in the computer's memory.
    13·1 answer
  • You've just purchased 10 new notebook systems for your users. You are concerned that users will leave the systems on for long pe
    10·1 answer
  • Find the names of these cities with temperature and condition whose condition is neither sunny nor cloudy.
    15·1 answer
  • Will give brainliest!<br> Who created binary, and does anyone have any idea how?
    13·1 answer
  • 50 POINTS
    6·1 answer
  • How do I change the keyboard light colors on Alienware 17 R5?
    8·1 answer
  • (2) Design a program to determine if a student is entitled to an incentive granted upon payment of
    13·1 answer
  • If you are connected to a network that uses DHCP, and you need to terminate your Windows workstation's DHCP lease, which command
    12·1 answer
  • what is a simulation? a) simulation is the process of creating dashboards in excel. b) simulation is the process of complex form
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!