Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A website requires that passwords only contain numbers. For each character in passPhrase that is not a number, replace the character with ' 0 '

A website requires that passwords only contain numbers. For each character in passPhrase that is not a number, replace the character with '0'(the number zero).
Ex: If the input is 2>43, then the output is:
Valid password: 2043
Note: isdigit() returns true if a character is a digit, and false otherwise. Ex: isdigit('8') returns true. isdigit('a') returns false #include
#include
using namespace std;
int main(){
string passPhrase;
unsigned int i;
getline(cin, passPhrase);
/* Your code goes here */
cout << "Valid password: "<< passPhrase << endl;
return 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

Recommended Textbook for

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions

Question

Find the derivative of y= cos cos (x + 2x)

Answered: 1 week ago

Question

What about leadership lessons from particularly good or bad bosses?

Answered: 1 week ago

Question

How would you assess the value of an approach like this?

Answered: 1 week ago