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

  Creating a program that works as a grammar checker

My project is about creating a program that works as a grammar checker for Arab students of age 15+. I’m not asking you to create a grammar checker from the scratch, but you will be given bellow the mistakes that needs to be corrected.

  Write a program that will calculate number of square feet

write a program that will calculate the number of square feet (living space) in a 4-room house. Your analysis should be clearly written and demonstrate your thought process and steps used to analyze the problem.

  Write a report of about 900 words that- identifies at least

write a report of about 900 words that- identifies at least 3 users of hr services internal to your organisation and

  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.

  What is the value displayed on the led

In the Data1: window, right click on num1, then left click on Show Location.  The value of the initialized variables should appear in the Memory window. Cut and paste the Memory window. What is the value displayed on the LEDs after you single step th..

  Program that satisfies requirements of programming project

Write a program that satisfies the requirements of Programming Project 2 of Hanly, and that uses the following modifications and tips -Use the COLOR_CODES string array.

  Design a real time flood monitoring system

Assignment 3: Design a Real Time Flood Monitoring System based on Arduino Microcontroller. The system should monitor flood related information like Water level and Precipitation. The data collected from the sensors should be transferred to a client a..

  My goal is to write down a php database application with a

my goal is to write a php database application with a gui that will display and update information on a remote database

  Create a windows application and design document

create a complete C# Windows application and design documents based on the following specifications and instructions.

  Application to convert kilometers in miles

Application will input number of kilometers, compute number of miles, and display number of miles. You will use a constant to store the kilometers-to-miles conversion factor.

  Write program to calculate tips for services rendered

Write program to calculate tips for services rendered. The program must request person's occupation, amount of the bill and the percentage tip as input

  Program to assign anonymous array of double value

Write c++ statements to permit the user to enter n, number of values to be processed; then assign an anonymous array of n double values, storing its address in doublPtr.

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