Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You need to generate passwords for a user repeatedly until the user exits the program with 0. Each password will have 5 to 15 characters

You need to generate passwords for a user repeatedly until the user exits the program with 0. Each password will have 5 to 15 characters (lower case letters, uppercase letters, and digits). Users enter the length of the password. No special chars and punctuation are allowed in passwords. Each password have at least two, at most four digits at random locations. Number of digits will be randomly determined. You will ask the user to enter the length of the password until the user enters 0, meaning to the user wants to exit the program. See examples below. As a part of this assignment, you need to design and call a function that takes one parameter. This parameter determines char to be return from the function: a random upper case letter, or a random lower case letter, or a random digit.

How many characters do you want in the password:7

kS0g8k9

How many characters do you want in the password:10

pLs7s5gTs1

How many characters do you want in the password:4

!!Enter between 5-15.

How many characters do you want in the password:15

8RGsdTf6w52PrfT

How many characters do you want in the password:0

Bye...

Note: A char variable, such as char x = 122, will be printed as a character (such as 'z') on screen. Check an ASCII table. Do not use string library and arrays.

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_2

Step: 3

blur-text-image_3

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

Database Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions