answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
fenix001 [56]
2 years ago
10

Assume we have already defined a variable of type String called password with the following line of code: password' can have any

String value String password ???"; However, because of increased security mandated by UCSD's technical support team, we need to verify that passwo rd is secure enough. Specifically, assume that a given password must have all of the following properties to be considered "secure": It must be at least 7 characters long .It must have characters from at least 3 of the following 4 categories: Uppercase (A-Z), Lowercase (a-z), Digits (0-9), and Symbols TASK: If password is secure, print "secure", otherwise, print "insecure" HINT: You can assume that any char that is not a letter (A-Z, a-z) and is not a digit (0-9) is a symbol. EXAMPLE: "UCSDcse11" would be valid because it is at least 7 characters long (it's 9 characters long), it has at least one uppercase letter (U', 'C', 'S', and 'D'), it has at least one lowercase letter (c', 's', and 'e'), and it has at least one digit (1' and '1') EXAMPLE: "UCSanDiego" would be invalid because, while it is 10 characters long, it only has uppercase and lowercase letters, so it only has characters from 2 of the 4 categories listed Sample Input: UCSDcse11 Sample Output: secure
Engineering
1 answer:
omeli [17]2 years ago
5 0

Answer:

The Java code is given below with appropriate comments for better understanding

Explanation:

import java.util.Scanner;

public class ValidatePassword {

  public static void main(String[] args) {

      Scanner input = new Scanner(System.in);

          System.out.print("Enter a password: ");

          String password = input.nextLine();

          int count = chkPswd(password);

          if (count >= 3)

              System.out.println("Secure");

          else

              System.out.println("Not Secure");

  }

  public static int chkPswd(String pwd) {

      int count = 0;

      if (checkForSpecial(pwd))

          count++;

      if (checkForUpperCasae(pwd))

          count++;

      if (checkForLowerCasae(pwd))

          count++;

      if (checkForDigit(pwd))

          count++;

      return count;

  }

  // checks if password has 8 characters

  public static boolean checkCharCount(String pwd) {

      return pwd.length() >= 7;

  }

  // checks if password has checkForUpperCasae

  public static boolean checkForUpperCasae(String pwd) {

      for (int i = 0; i < pwd.length(); i++)

          if (Character.isLetter(pwd.charAt(i)) && Character.isUpperCase(pwd.charAt(i)))

              return true;

      return false;

  }

  public static boolean checkForLowerCasae(String pwd) {

      for (int i = 0; i < pwd.length(); i++)

          if (Character.isLetter(pwd.charAt(i)) && Character.isLowerCase(pwd.charAt(i)))

              return true;

      return false;

  }

  // checks if password contains digit

  public static boolean checkForDigit(String pwd) {

      for (int i = 0; i < pwd.length(); i++)

          if (Character.isDigit(pwd.charAt(i)))

              return true;

      return false;

  }

  // checks if password has special char

  public static boolean checkForSpecial(String pwd) {

      String spl = "[email protected]#$%^&*(";

      for (int i = 0; i < pwd.length(); i++)

          if (spl.contains(pwd.charAt(i) + ""))

              return true;

      return false;

  }

}

You might be interested in
Suppose we store a relation R (x,y) in a grid file. Both attributes have a range of values from 0 to 1000. The partitions of thi
leva [86]

Answer:

For (a) The total number of buckets from the given query for the relation is 25 buckets (b) the nearest neighboring query is (80, 200) (80, 150), (100, 150), (120,150) and (120, 200)

Explanation:

From the question stated, we need to define what a Grid file is

Grid File it is a structure of data that are used to divide the total space into a grid non-periodic, where set of point (small) are defined by more than one cells of the grid.

(a)Finding buckets for the query

The relation is divided into two parts which ranges from 0 to 1000, the first part is partitioned in every 20 units, at 20, 40, 60 etc; a second part is partitioned into every 50 units at 50, 100, 150 etc.

The total number of buckets from the given query for the relation is 25 buckets

(b)Finding the closest point or nearest point

The closest point discovered in the distance is little above 15

These points are are the points closer to the point target (110, 205) which can be found in five neighboring rectangles with left corners lower is stated as follows:

(80, 200) (80, 150), (100, 150), (120,150) and (120, 200)

3 0
2 years ago
The ingredient weights for making 1 yd (cyd) of concrete by assuming aggregates in SSD state are given below. The volume of air
Pachacha [2.7K]

Answer:

Explanation:

Ans) Given batch weight of each component :

Cement = 700 lb

Water = 315 lb

Coarse aggregate = 1575 lb

Fine aggregate = 1100 lb

Part 1) Amount of water = 328.5 lb

Amount of water is needed to be increased if the aggregates has absorption capacity, To maintain constant water cement ratio, the mixing water is increased because some of the water is absorbed by aggregates.

Amount of water absorbed = 328.5 lb - 315 lb = 13.5 lb

Total amount of aggregates = 1575 + 1100 = 2675 lb

=> % Absorption capacity = 13.5 x 100 / 2675 = 0.5 %

Hence, new amount of Coarse aggregate = (1 - 0.005) x 1575 lb = 1567.125 lb

New amount of fine aggregate = (1 - 0.005) x 1100 = 1094.5 lb

Since, water cement ratio is maintained constant , amount of cement remains unchanged

=> Volume of water = 328.5 / 62.4 = 5.26 ft3

=> Volume of cement = 700 / (3.15 x 62.4) = 3.56 ft3

=> Volume of coarse aggregate = 1567.125 / (2.4 x 62.4) = 10.46 ft3

=> Volume of fine aggregate = 1100 / (2.4 x 62.4) = 7.34 ft3

Volume of air = 2% = 0.02 x 27 = 0.54 ft3

Total concrete volume = 5.26 + 3.56 + 10.46 + 7.34 + 0.54 \approx 27 ft3 = 1 yd3

Hence, calculated amount of each component is correct

Part 2) We know, minus sign indicated that the aggregate will absorb some moisture from concrete, hence mixing water amount needed to be corrected .

=> Amount of water absorbed by coarse aggregate = 0.01 x 1567.125 lb = 15.67 lb

=> Amount of water absorbed by fine aggregate = 0.02 x 1094.50 lb = 21.89 lb

Total amount of water absorbed = 15.67 + 21.89 = 37.56 lb

To maintain same water cement ratio, amount of mixing water is needed to be increased

=> Corrected amount of mixing water = 328.5 lb + 37.56 lb = 366 lb

=> Corrected amount of coarse aggregate = (1 - 0.01) x 1567.125 = 1551.45 lb

=> Corrected amount of fine aggregate = (1 - 0.02) x 1094.5 = 1072.6 lb

Part 3) We know,

Unit weight = Sum of weight of each material / Total volume

=> Sum of weight = 366 + 700 + 1551.45 + 1072.6 = 3690.05 lb

Total volume = 1 yd3 or 27 ft3

=> Expected Unit Weight = 3690.05 lb / 27 ft3 = 136.67 lb/ft3

Also, Concrete Yield = Weight of all components / Unit weight of concrete

=> Yield = 3690.05 / 136.67 = 27 ft3 or 1 yd3

4 0
2 years ago
An electrical utility delivers 6.25E10 kWh of power to its customers in a year. What is the average power required during the ye
Sindrei [870]

Answer:

The overall Utility delivered to customers in a year 'U' = 6.25 X 10¹⁰Kwh

However, the average power P, required for a year, t  = ? Kw

Expressing their relationship, we will have

             U = P x t

Given t = 1 year = 24 x 365 hours (assume a year operation is 365 days)

          t = 8760 hours

P = \frac{62500000000}{8760}

P = 7134.7Kw

Hence, the average power required during the year is 7,135Kw

Now to calculate the energy used by the power plant in a year (in quads)?

Recall, Efficiency, η = Power Output/Power Input (100)

so, we have

η = P₀/P₁, given

0.45 = \frac{7134.7Kw}{P₁}

P₁ = 15,855Kw

the total energy E₁ used in a year = 15,855x24x365 = 138.89MJoules

So to convert this to quads, Note;

1 quads of energy = 10¹⁵ Joules

The total energy used is 0.000000139 quads

Now to find the cubic feet of natural gas required to generate this power?

Note: 0.29Kwh of Power generated  = 1 cubic feet of natural gas used

Since, the power plant generated = 62500000000Kwh

The cubic feet of natural gas used = \frac{62500000000}{0.29}

Hence, 2.155x10²⁰cubic feet of N.gas was used to generate this much power.

8 0
2 years ago
Universal Containers has a junction object called "Job Production Facility". With 2 master-detail relationships to the Job and P
alexdok [17]

Answer:

C. The user will not be able to see the junction object records or the field values.

Explanation:

For the profile of the user to give access permission such as create and read to the job without granting access permission to the production facility object, the value of the field or records of the junction object will not be seen by the user. This is one of the necessary criteria or principle for the universal container with a junction object.

3 0
2 years ago
Explain why the fundamental software engineering principles of process, dependability, requirements management, and reuse are re
Svet_ta [14]

Answer:

1. Costs and frequency of change.

2. The most important ‘non-functional’ requirements. Different systems have different priorities for non-functional requirements.

3. The software lifetime and delivery schedule.

Explanation:

The process of requirement gathering is required in both generic and customized software.

• A document to define the development process is required in all type of software application.

• Updating is required in each type of software. For doing so, new version of each type of software is released.

• Maintenance is an important part of software development. It is required in each type of application development.

• Software has some minimum requirements to execute. So, platform dependability is considered in all software development.

5 0
2 years ago
Read 2 more answers
Other questions:
  • A hydrogen-filled balloon to be used in high altitude atmosphere studies will eventually be 100 ft in diameter. At 150,000 ft, t
    7·1 answer
  • A woman approaches a room attendant with a letter. She requests that the attendant leave the letter in Room 1201. Which is the m
    9·1 answer
  • A long aluminum wire of diameter 3 mm is extruded at a temperature of 280°C. The wire is subjected to cross air flow at 20°C at
    9·1 answer
  • Universal Containers (UC) has a requirement to expose a web service to their business partners. The web service will be used to
    10·1 answer
  • A negative pressure respirator brings fresh air to you through a hose<br>A) True<br>B)False​
    15·2 answers
  • a. (24 points) Describe the microstructure present in a 10110 steel after each step in each of the following heat treatments (no
    10·1 answer
  • A soil element is subjected to a minor principle stress of 50 kPa on a plane rotated 20 ° counterclockwise from vertical. If the
    10·1 answer
  • What is the linear distance traveled in one revolution of a 36-inch wheel
    6·1 answer
  • 1. A _____ is applied to a wall or roof rafters to add strength and keep the building straight and plumb.
    9·1 answer
  • A surface grinding operation is used to finish a flat plate that is 5.50 in wide and 12.500 in long. The starting thickness is 1
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!