Kat H.

asked • 04/12/21

Passcode Checker. Users of a system are supposed to pick a 3 character pass code such that there is at least one character that is a digit (number) and one character that is not a letter or number.

Users of a system are supposed to pick a 3 character pass code such that there is at least one character that is a digit (number) and one character that is not a letter or number. Something like "A7*" or "45!" or "$2C". The digit and the special symbol may be any of the three characters.

Write a program that reads in three characters and prints YES if they meet the criteria and NO if they do not.

Hints:

  1. Remember cctype has functions for isalpha, isdigit, and ispunct. Check the documentation here.
  2. Also remember that ! is NOT. You can express the idea "x is not a digit character" with:
!isdigit(x)


Code:


#include <iostream>


You probably want the char type library...


using namespace std;


int main()

{

//YOUR_CODE

}

1 Expert Answer

By:

Patrick B. answered • 04/12/21

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.