Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

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

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M92062925
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in Programming Language

Task silly name testeroverviewcontrol flow allows us to

Task: Silly Name Tester Overview Control flow allows us to alter the order in which our programs execute. Building on our knowledge of variables, we can now use control flow to create programs that perform more than just ...

Question 1 what is hadoop explaining hadoop 2 what is

Question: 1. What is Hadoop (Explaining Hadoop) ? 2. What is HDFS? 3. What is YARN (Yet Another Resource Negotiator)? The response must be typed, single spaced, must be in times new roman font (size 12) and must follow t ...

Php amp session managment assignment -this assignment looks

PHP & SESSION MANAGMENT ASSIGNMENT - This assignment looks at using PHP for creating cookies and session management. Class Exercise - Web Project: Member Registration/Login This exercise will cover adding data connectivi ...

Task arrays and structsoverviewin this task you will

Task: Arrays and Structs Overview In this task you will continue to work on the knight database to help Camelot keep track of all of their knights. We can now add a kingdom struct to help work with and manage all of the ...

Assignment - haskell program for regular expression

Assignment - Haskell Program for Regular Expression Matching Your assignment is to modify the slowgrep.hs Haskell program presented in class and the online notes, according to the instructions below. You may carry out th ...

Assignment task -q1 a the fibonacci numbers are the numbers

Assignment Task - Q1. (a) The Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and are characterised by the fact that every number after the first two is the sum of the ...

Task - hand execution of arraysoverviewin this task you

Task - Hand Execution of Arrays Overview In this task you will demonstrate how arrays work by hand executing a number of small code snippets. Instructions Watch the Hand Execution with Arrays video, this shows how to ste ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Question - create a microsoft word macro using vba visual

Question - Create a Microsoft Word macro using VBA (Visual Basic for Applications). Name the macro "highlight." The macro should highlight every third line of text in a document. (Imagine creating highlighting that will ...

Overviewthis tasks provides you an opportunity to get

Overview This tasks provides you an opportunity to get feedback on your Learning Summary Report. The Learning Summary Report outlines how the work you have completed demonstrates that you have met all of the unit's learn ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As