Write a function, named randomPassword, that generates a random password that takes no parameter. It will return the randomly generated password as its ONLY result. Display the randomly generated password in the main program. Password Criteria: o   The password should have a random length of between 7 and 10 characters.  o   Each character should be randomly selected from positions 33 to 126 from the ASCII table  You must import randint function directly and inline within the random package and it must be the first line of code in your program, after your program header comment. o   Declaring and using FOUR constants.  Constants must be named appropriately and intuitively. o   You must use the chr built-in function within your randomPassword function: o   Declaring the main function and invoking randomPassword function. o   Logical approach to problem solving, computation, and displaying appropriate output.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter15: Recursion
Section: Chapter Questions
Problem 20PE
icon
Related questions
Question

Write a function, named randomPassword, that generates a random password that takes no parameter. It will return the randomly generated password as its ONLY result. Display the randomly generated password in the main program.

Password Criteria:

o   The password should have a random length of between 7 and 10 characters. 

o   Each character should be randomly selected from positions 33 to 126 from the ASCII table

 You must import randint function directly and inline within the random package and it must be the first line of code in your program, after your program header comment.

o   Declaring and using FOUR constants.  Constants must be named appropriately and intuitively.

o   You must use the chr built-in function within your randomPassword function:

o   Declaring the main function and invoking randomPassword function.

o   Logical approach to problem solving, computation, and displaying appropriate output.

 

 

Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Types of Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,