Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Hi I'm not familiar with using Microsoft Visual C# Express 2010. Please help me with this project and provide instructions. Figure 1 rigume 4 In

Hi I'm not familiar with using Microsoft Visual C# Express 2010.

Please help me with this project and provide instructions.

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Figure 1 rigume 4 In this project you will use the decision and repetition control structures to create a password checker that verifies a userentered password meets the requirements of being a user-defined minimum length, having one capital letter, having one lowercase letter, having one number, having one special character and does not include a space. Objectives: - Use of if/else if/else statement (decision structure) - Random number generation - Use of nested and "block" if - Use of InputBox - Use of relational \& logical operators - Parsing strings - Use of a flag - Use of chars - Use of loop (repetition structure) - Use of ASClI values - Use of listbox - Use of int. TryParse Requirements: - User will enter a valid number of 4 or more for a minimum password length - this is the minimum number of characters a password MUST contain A message box saying Please enter a valid number of 4 or more for Minimum Password Length will be displayed if the number is either invalid (not a number at all) or has a value under 4 - User will enter a password and the program will check to ensure it is valid: Password must be >= the minimum required password length - If the actual password length does not meet the minimum required password length the user will be endlessly prompted to re-enter a password until it does (Fig 2) The password (randomly generated or user-entered) will be checked to ensure at least 1 of each of the following is used: - Minimum character requirement met - Capital letter - Lowercase letter - Number - Special character that is not a space - A Generate button will randomly create a valid password meeting length and valid password criteria The password textbox will be populated with the randomly created password Intro to Visual Programming - CS 114/IST 140 Storm-Page 2 - During the password checking process the following line will be added to a listbox (Fig 1) for each password character checked: - Position is with ASCII Value - When finished checking the password If any characters were a space - A MessageBox will notify the user that spaces are not allowed - "A Space IS NOT a valid special character", "No Spaces Allowed" - The password textbox will be cleared If none of the characters were spaces the program will display either a checkmark or x next to the required criteria indicating whether or not it was met (Fig 1) While there are several ways to approach this project, the first thing to remember how to eat an elephant. The second is to consider the following... - You will need to identify and declare the following variables intRequiredPassLen; //Required number of chars for password (min of 4 ) intActualPassLen; //Actual length of password entered by the user strPass; //user entered password chrPassChar = ' '; //individual character in user-entered password intASCIIVal; //ASCII value of char - You will also need to declare and check several flags for this project such as: blnHasCap blnHasNum blnHasSpecialChar etc. - Once you have declared your variables you will need to start by checking the user-entered Minimum Password Length - Create an if statement with an int.TryParse - Use logical operators to test for both valid number and entered number being greater than/equal to user entered minimum password length If both are true, all validation code will fit snuggly in the if If either are false, the else will display the error message and you can assume the user entered a space for the password - Next, get the actual length of the user-entered password and compare it to the required minim length - Use while loop with an inputbox to reassign the actual password length variable - Once the password meets the user-entered Minimum Password Length or more you can trip the bInlsValidLength flag - With the length of the password known fulfill the Use a For loop starting at position 0 and iterating though each character of the password Get the character's ASCII value Check each possible valid condition (is it capital, is it a space, etc) one-by-one tripping the flag if true - Use logical operators to check the range of the individual password character against the ASCII value for number, capital, lowercase, and special characters - Use the not operator (negation) to check for a space - While you are looping through each character of the password, enter the required information int the listbox - Once you have looped through each character of the password, tripped the flags and populated the listbox, use an if structure to see if a space was part of the password - If it was, show the required MessageBox - If it was not, update the checkmark/x pics based on the flags - For the Generate Password button Create a strPassword variable to hold the generated password Choose one of the 4 required character (capital, lower case, etc) Randomly generate a number in the range corresponding to the ASCII value of that character Convert that ASCII value to a char Concatenate that char to the strPassword variable Repeat 2 more times, the strPassword variable will have a length of 3 containing 3 of the 4 required characters You'll have to figure out the rest keeping the following in mind - You will need a loop relating to the required minimum length of the password - In the loop you will be ASCII generating, character convertin', and string concatenating until the minimum password requirement is met - You will set the text property of the password textbox to the generated password The program outline (if your program structure does not look like this, you might be over-complicating it): //Declare local variables and get user input for required password length and the password to be checked if required password length was an actual number >=4// use a try/parse here get actual password length do while actual password length x=0 to

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions