Functions and Recursions – Strings – Problem #7

IIT Kharagpur CS10001 / CS11001 Programming and Data Structures Lab Question Archive

Difficulty: hard

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

Back to Lab Problems
Functions and Recursions/Strings/Problem #7

Lab Problem Statement

Specifications & Problem DetailsIIT Kharagpur PDS Archive
Loading question...

Interactive C Compiler · Problem #7

WASM In-Browser

Runs directly on your machine · Zero remote server dependency

Compiler downloads on first Run (large, saved in your browser after that)
main.cCtrl + Enter to run
1
2
3
4
5
6
7
Input (stdin)given to scanf / cin
Output

Output appears here. Press Run to compile and execute.