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
What are wizard ranks in brainly​
Hunter-Best [27]

Answer:

Brainly gives special ranks to users who give outstanding performance in a specific subject. These ranks are known as Wizard rank. Specifically for only one person in each subjects: Maths, Chemistry, Physics, Biology, and English.

Explanation:

4 0
3 years ago
Read 2 more answers
Computer A has an overall CPI of 1.3 and can be run at a clock rate of 600 MHz. Computer B has a CPI of 2.5 and can be run at a
kirill115 [55]

Answer:

Check the explanation

Explanation:

CPI means Clock cycle per Instruction

given Clock rate 600 MHz then clock time is Cー 1.67nSec clockrate 600M

Execution time is given by following Formula.

Execution Time(CPU time) = CPI*Instruction Count * clock time = \frac{CPI*Instruction Count}{ClockRate}

a)

for system A CPU time is 1.3 * 100, 000 600 106

= 216.67 micro sec.

b)

for system B CPU time is =\frac{2.5*100,000}{750*10^6}

= 333.33 micro sec

c) Since the system B is slower than system A, So the system A executes the given program in less time

Hence take CPU execution time of system B as CPU time of System A.

therefore

216.67 micro = =\frac{2.5*Instruction}{750*10^6}

Instructions = 216.67*750/2.5

= 65001

hence 65001 instruction are needed for executing program By system B. to complete the program as fast as system A

3 0
3 years ago
Protocols at which layer of the OSI model have the primary function of moving datagrams through an internetwork connected by rou
Vladimir [108]

Answer:

"Network layer" is the correct answer to the given question .  

Explanation:

The network layer is interconnected with different networks by providing permission to the network. This job is done by sending the packets in the network. The main aim of the network layer is to provide the logical addressing, routing, and fragmentation of packets.

The network layer is the layer of the OSI model whose primary function is moving the packets or datagrams in the internetwork which is connected by the routers.  

5 0
3 years ago
Can run mobile-style apps in the area known as the start screen, while running traditional software in the more familiar desktop
Travka [436]
The correct answer: Yes, mobile-style apps can run in a personal computer's desktop.

That is possible by means of a desktop application called emulatator. An emulator like Bluestacks allows a personal computer to run mobile-style apps by acting as a virtual drive in the personal computer's harddisk. 

Emulation is successful if the system requirements of the mobile-application is met by the personal computer's system attributes such as Random Access Memory abundance, Random Access Memory speed, Processing speed (in some cases core abundance e.g. core 2) etc. 

Some mobile-applications do not work in the personal computer's desktop, however, if this application requires platform specific functions such as mobile device's network provider etc.
4 0
4 years ago
50 points please!!
MA_775_DIABLO [31]

Answer:

poopypoopypoopypoopy

6 0
3 years ago
Other questions:
  • The ____ category of apps makes the computer easier for blind people to use.
    9·1 answer
  • As a bank employee, you often work from home and remotely access a file server on the bank’s network to correct errors in financ
    8·1 answer
  • What is the TAG to begin a Web page, as recommended by the W3C?
    13·1 answer
  • You have to calculate the total amount you spent at the mall today. Which function should you use to do so?
    6·2 answers
  • What is meant by the phrase "backing up your data"?
    15·1 answer
  • If a triathlon is a sport combining three events, what do you think would be the word for a sport combining five events?
    7·1 answer
  • When browsing using certain browsers, if a page is known to be malicious or using phishing techniques in the past a browser may
    5·1 answer
  • Giving 5 stars, a Thanks, 80 points, and Branliest to whoever answers them correctly.
    9·1 answer
  • Suppose cell C5 contains the formula =B$6+C1.
    6·1 answer
  • 100POINTS!!!!!!!!!!!!!!!!!!!I WILL ANSWER ALL OF YOUR QUESTIONS PLEASE LOVES:)))Upload your completed project including the foll
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!