Functions and Recursions – Strings – Problem #7
IIT Kharagpur CS10001 / CS11001 Programming and Data Structures Lab Question Archive
Problem Statement
In this Question, we will test if a generated password in some website is valid or not. A user will give a username and a password as string inputs. Our task is to verify if the password is acceptable or not, which is checked from the following rules: a. The password can not be the same as the username, and it can't contain the username as a part of it b. There should be at least 8 characters in the password c. The maximum length of the password can be 15 d. It should contain at least one lowercase, one uppercase, and at least two characters from the following: $, *, +, /, #, @, <, >, ?, _, ! e. There can be maximum 5 consecutive digits in the password f. There can't be more than 5 repeated characters You are not allowed to use/call any String.h library functions. Feel free to write your own functions and invoke them. Example 1: username: harrisjh password: h67dQ*+R62 Acceptable Example 2: username: david1 password: 45Cxdavid1*?I Not acceptable Example 3: username: jdoe123 password: uPG10/rrX Not acceptable