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

  Create a r-wr property named validlastname stores string

Create a read-write property named ValidLastName that stores a String value in the hidden variable mstrLastName.

  Design a flowchart or pseudocode

Design a flowchart or pseudocode for the following:A program that accepts a candy name (for example, "chocolate-covered blueberries"), price per pound, and number of pounds sold in the average month, and displays the item's data only if it is a be..

  Write program to display companys payroll report in list box

Write down the program to display companys payroll report in list box. Program must read each employee's name, hourly rate, and hours worked from file and produce report.

  Program to read the contents of file into the array

Write down the program which asks user for a file name. Suppsoe the file contains the series of numbers, each written on separate line.

  Write a code to locate and rank keywords

You are working on the custom Web application to design document library for client. Write code to locate and rank the keywords. You have been given sample document to use for testing.

  Write program-compute average using floating-point numbers

Write a program that will accept as input between 2 and 25 numbers and then calculate the average of the numbers. Make sure you use floating-point numbers in case the average is not a whole number.

  Briefly describe the properties of type system

Briefly describe the properties of type system of the corresponding programming language. Pay attention to each of the statements since there are a few obvious statements you can make

  Linux directory log

Linux Directory Log, Directions: As you complete each of the following steps, keep track of what occurs at each point, including what you type, the output given, and if you experience any errors. Record the occurrences in the following matrix.

  Write a shell script to send customized mail message to user

Write a shell script to send a customized mail message to the users listed on the command line by login (user) name, only if they are currently logged on. If no users are listed on the command line, an error message should be printed.

  Write a program that computes the monthly gross pay

The owners of the Super Supermarket would like to have a program that computes the monthly gross pay of their employees as well as the employee's net pay.

  Ms word versus other processing program

MS word Versus other processing program

  Using a software program to create story books

submit a unit plan spanning Two to Four weeks. See this example of a unit plan, (or search the web for a unit plan example that best suits matches your needs). Technology should be integrated for assessment, instruction, and student engagement..

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