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

  Generate a specified number of solid colour square

COSC1519 Introduction to Programming - Define a function createSquareTile(numTiles, prefix) which generates a specified number of solid colour square tile pictures with the size and colour of each picture specified by the user.

  Write a complete java program that produces the sequence

Write a complete Java program that produces this sequence of numbers using a for loop. Create a complete Java program in a class named Bday that declares four variables and assigns appropriate values to them.

  Application development and programming languages

Compare and contrast object-oriented languages (Java, C++, C#, etc.) to imperative languages (C, Pascal, etc.) in terms of:

  Call the functions in the program

Have the main program call these functions to demonstrate how they work. Also, if you could help to explain to me how both constructors can be replaced with one constructor by using a single constructor with default parameters.

  Program to simulate the operation of the simmac

CISC 640 - OS Problem Set - Write three programs in the machine language of the SIMMAC that will total the numbers stored in 20 different locations and place the result in a single location.

  Create a draft program design

Start creating the program structure using the provided integrated development environment (IDE). Create a draft program design

  Design a system for the organization

explain the main systems in place, discuss the integration, and explain how the data collected by these systems helps the organization make decisions and carry out the strategic plan.

  Write a program for a calculator

Write a program for a Calculator that can do two operations, + and -. This calculator should be able to add or subtract two numbers of any size. You may use Recursion if you want.

  Which quality control method should the manager adopt. why

Type I error probability is defined as the conditional probability of rejecting a good lot. Type II error probability is defined as the conditional probability of accepting a poor quality lot.

  Create the program uses two arrays to hold employee names

Create the program which uses two arrays: one to hold employee names and one to hold employee salaries (standard US currency, two decimal points). The program must prompt user to enter employee names.

  Write program to prints question do you want to continue

Write a program which prints question"do you want to continue?"and reads user input. if user input is"y", "yes", "ok", "sure", or "why not?" , print out "ok".

  Write a program that asks how many tickets sales

Write a program that asks how many tickets sales. Format your dollar amount in a fixed-point notation with two decimal points and make sure the decimal point is always displayed.

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