Level contains the lines in each paragraph

Assignment Help Business Management
Reference no: EM132399202

If a 3-Dimensional array is defined by the following statement where the first level (dimension) contains the pages, the second level contains the paragraphs in each page, and the third level contains the lines in each paragraph:

final String [ ] [ ] [ ] book = {

{//text 1} , { //text 2} , {//text3} }

What is the Java code that will generate a password from this array respecting the following restrictions:

1. A password is composed of three words.

2. The page number, paragraph number, and line number are chosen randomly. You must use the java.util.Random class to generate random numbers using the nextInt() method.

3. Convert the String from the chosen line into an array of words using the split(" ") method (space as the separator).

4. Choose a random word from the array in Step 3. (Hint: the length attribute of an array will tell you how many words are in the array.)

5. If a word is composed of only a single character (e.g., "a"), or the word contains the newline character ('n'), go back to Step 2.

6. When you have three words, concatenate them to form a candidate password, and apply the following steps. You can use the compareTo() method from the String class

(but no HashSet). Restriction: Don't use any method from the Character class.

a. No two words can be exactly the same (e.g., "theAlicethe" isn't allowed, but "the" and "The" are accepted). Otherwise, go back to Step 2.

b. The password must be of at least 8 characters long but under 16 characters. Otherwise, go back to Step 2.

c. The password must contain an uppercase character. Otherwise, go back to Step 2.

d. The password must contain a lowercase character. Otherwise, go back to Step 2.

e. The password must contain only one special (non-alphabetic) character. Otherwise, go back to Step 2. Restriction: Don't use any method from the Character class.

f. If all conditions are met, you print the password, along with the number of password generation attempts that failed due to: (i) having a newline character, (ii) having a single.

character word, (iii) having the same words, (iv) not meeting the uppercase requirement, (v) not meeting the lowercase requirement, (vi) not meeting the special character.

Requirement.

7. You continue generating passwords until you generate a total of 10,000 passwords, OR if you generate a password where the count for item (v) in Step 6 f) is non-zero.

Reference no: EM132399202

Questions Cloud

Type in command that help you locate those commands : In PowerShell Scripting, You need to locate commands that deal with printers. Type in command that help you locate those commands.
711SHRM Strategic Human Resource Management Assignment : 711SHRM Strategic Human Resource Management Assignment Help and Solution - Australian Institute of Business, Australia. Write a report about HRM issue
Analyze the sas organics dataset : Analyze the SAS ORGANICS dataset provided with this assignment. Follow the high level procedure given below to create a SAS data source.
Analyze this dataset and put summary of findings in jupyter : Analyze this dataset and put the summary of findings in Jupyter notebook based on the analysis. Put what you think are the most interesting findings.
Level contains the lines in each paragraph : If a 3-Dimensional array is defined by the following statement where the first level (dimension) contains the pages, the second level contains the paragraphs
What is the advantage of analysis dashboards : What is the advantage of analysis dashboards? Give an example of application dashboards.
722CGOV Corporate Governance - Concepts and Practices : 722CGOV Corporate Governance: Concepts and Practices Assignment Help and Solution - Australian Institute of Business, Australia
Phases of developing an enterprise security system : Briefly describe a business impact analysis (BIA) and what it estimates and identifies.
Analyze the time required and give corresponding pseudocode : Give the algorithm iteratively with memoization. Analyze the time required and give corresponding pseudocode

Reviews

Write a Review

Business Management Questions & Answers

  What is the amount of payment

He agrees to make payments at the end of each month for 5 years. He pays 5% interest, compounded monthly. What is the amount of each payment?

  Assignment-setup a network

Once you have built an OSPF network consisting of 3 routers, you are ready to move on to the next part of this assignment. Perform static packet filtering using an access list to restrict access from the networks on RT1's fa0/1 interface to RT3's ..

  The origin and subsequent evolution of the workplace values

Analyze and explain the origin(s) and subsequent evolution of your personal and workplace values.

  Credible scenario for preservation of fishing habitat

Imagine that a contingent valuation study offers households a credible scenario for preservation of fishing habitat and receives the following approval rates

  Taxes on repatriated earnings that companies operating

Some have argued in favor of reducing taxes on repatriated earnings that companies operating in the United States have made in other countries. Such a tax break could lead to a sharp increase in the amount of repatriated earnings and raise tax rev..

  Comparisons between hbr case honda

Can you summarize the key discussions from Honda (B) HBR case, and also provide the comparisons between HBR case Honda (B) with Honda (A) HBR case-March 2011 issue? Can you also provide your discussion on leveraging capabilities, and the focus on ..

  Senior analyst working for ameritrade

A senior analyst working for Ameritrade has reviewed purchases his customers have made over the last six months. He has categorized the mutual funds purchased into eight categories: (1) Aggressive Growth (AG) - (2) Growth (G) - (3) Growth-Income (..

  You have ever been involved in agency relationship

What is Agency Relationship? Feel free to tell me if you have ever been involved in an agency relationship. Be sure to tell me how it is created and terminated.

  Relative error for the quantity

1. Determine the % relative error for the following quantity: (5.47±0.05) + (0.47±0.03) - (0.87±0.02)

  Ensure that your store starts to grown in sales

An action plan on what you and your team are doing to ensure that your store starts to grown in sales and how to to ensure you will get

  Forecast using trend-adjusted

What is this year's forecast using trend-adjusted (double) smoothing with alpha = .2 and beta = .1, if the forecast for last year was 56 the forecast

  How would the case be decided

How would the case be decided? Were there any ethical violations?

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