Create a program that generates a random password

Assignment Help Programming Languages
Reference no: EM131308295

Assignment

Many applications impose rules for user passwords. Write a program that utilizes methods to check a user entered password ***** print out either "Valid" or "Invalid", based on the following rules:

• Password ***** be at least 5 characters long, but no longer than 8 characters (in other words, valid password ***** is in the range: 5<=len<=8)

• Password ***** consists of only letters (upper or lower case, or some combination of upper and lower), digits, and special characters from the following set: !@#$%^&* (note: not every special character and punctuation mark is in this set. These characters correspond to Shift+1 through Shift+8 on the keyboard)

• Password ***** contain at least one digit, at least one letter, and at least one special character from the set defined in the point above.

Requirement: your program must include methods to perform these checks. Programs that do not use methods will not receive credit even if they function correctly.

Input: Prompt the user to enter a password.

Output: If the password ***** one or more of the rules, print out "Invalid", if it does not, print out "Valid".

Sample 1:

Please enter a password: A!2g

Invalid

Sample 2:

Please enter a password: A!2gt9

Valid

Sample 3:

Please enter a password: mnkys5

Invalid

Sample 4:

Please enter a password: mnkys5&

Valid

2) Create a program that generates a random password ***** user-defined length. For the purposes of this problem, we will assume that any character that corresponds to ASCII (decimal) values in the range 33-126 is a valid password ***** Hint: use the integer-character correspondence (generate random integers between 33 and 126, then convert them to characters).

Requirement: your program must include a method that generates and returns one random character. This method should be called some (user-specified) number of times by a loop that will use the returned characters to "build" the password ***** Programs that do not include this method will not receive credit even if they function correctly.

Input: Prompt the user to enter the length of the password ***** is to be generated by your program.

Output: A randomly-generated password ***** user-specified length.

Sample 1:

Please enter password *****: 3

Password: h3*

Sample 2:

Please enter password *****: 8

Password: bT7@y)w+

3) Write a method that displays an n-by-n matrix using the following header: public static void printMatrix(int n)

Each element in the matrix is either a 0 or a 1, generated randomly. Write a test program that prompts the user to enter n and displays an n-by-n matrix of zeroes and ones.

Requirement: Your program must includ the method defined above. Programs that do not include it will not receive credit, even if they function correctly.

Sample run:

Enter n: 3

0 1 0

0 0 0

1 0 1

Reference no: EM131308295

Questions Cloud

The company invests the money in an account : Snowball Enterprises received an investment of $392540 after winning a grant for new entrepreneurs. The company anticipates it will not see a profit for at least 4 years and would like to make the investment last that long. If the company invests the..
Create a web page with the information you have gained : Create a web page with the information you've gained. Include all of the necessary tags for an HTML file: , , , and tags.
Why did the mixture appear to boil : In the reaction of meso-stilbene dibromide, KOH and triethylene glycol and heat, if the KOH has a purity of 85% and the remainder is water; why did the mixture appear to boil?
Analyze the costs of obtaining finance from the sources : A company is trying to use one of the following source of finance, inorder to enhance its business. hence, Analyze the costs of obtaining finance from the following sources.
Create a program that generates a random password : Create a program that generates a random password ***** user-defined length. For the purposes of this problem, we will assume that any character that corresponds to ASCII (decimal) values.
Did intel use monopoly like power : Did Intel use monopoly-like power; in other words, did Intel achieve its objectives by relying on power that it had due to its control of a large portion of the market?
How the payment of dividends adds to the firms share value : Explore and discuss how dividend payments are accounted for; what signal(s) does the payment of dividends send to the investment community; and how the payment of dividends add's to the firm’s share value?
Deposited a bonus at the end of year : Bertie deposited $7714 into an account paying 9% compounded annually. He withdrew $2466 at the end of year 3. He deposited a bonus at the end of year 6. At the end of year 11 he had $26010 in the account. How much did Bertie deposit at the end of yea..
Job to give him time to develop and launch a new product : Kal would like to work for a few years and then leave his job to give him time to develop and launch a new product. Kal would like to make 8 equal annual deposits so he can have enough to live on while he develops his product. He plans to give himsel..

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd