Create a conditional expression that evaluates to string "negative" if userVal is less than 0, and "non-negative" otherwise. Ex: If userVal is -9, output is: -9 is negative.

Answers

Answer 1

Answer:

(userVal < 0) ? "negative" : "non-negative" ;

Explanation:

The above code has been written using Java's ternary operator (? : ).

Java uses this operator to write conditional expressions that are similar to the regular if ... else statements.

This expression has three parts,

i. the conditional statement: this is the expression before the ? mark. In this case, (userVal < 0). This expression contains the condition to be tested for and it returns true or false.

ii. the second part is the statement after the ? mark. In this case, "negative". This expression will be executed if the conditional statement returns true.

iii. the third part is the statement after the : mark. In this case, "non-negative". This expression will be executed if the conditional statement returns false.

So in this case, if userVal < 0, the string "negative" will be evaluated. Otherwise, "non-negative".


Related Questions

The method of breaking digital messages into small fixed bundles, transmitting them along different communication paths, and reassembling them at their destination is called:

Answers

Answer:

Packet switching

Explanation:

Packet switching - it is referred to as the transmission process which involved sending of packets through communication path and last reassembling them again.

The sending of packets is done by broken the digital message into required pieces for efficient transfer.  

in this process, every individual parcel is sent separately.

Check my work Check My Work button is now disabledItem 16Item 16 3 points As a spherical ammonia vapor bubble rises in liquid ammonia, its diameter changes from 1 cm to 3 cm. Calculate the amount of work produced by this bubble, in kJ, if the surface tension of ammonia is 0.07 N/m.

Answers

Answer:

W = 1.7593 * 10 ^ (-7) KJ

Explanation:

The work done by the bubble is given:

[tex]W = sigma*\int\limits^2_1 {} \, dA \\\\W = sigma*( {A_{2} - A_{1} } ) \\\\A = pi*D^2\\\\W = sigma*pi*(D^2_{2} - D^2_{1})\\\\W = 0.07 * pi * (0.03^2 - 0.01^2)*10^(-3)\\\\W = 1.7593 *10^(-7) KJ[/tex]

Answer: W = 1.7593 * 10 ^ (-7) KJ

One AA battery in a flashlight stores 9400 J. The three LED flashlight bulbs consume 0.5 W. How many hours will the flashlight last?

Answers

Answer:

time = 5.22 hr

Explanation:

Given data:

Energy of battery = 9400 J

Power consumed by three led bulb is 0.5 watt

we know Power is give as

[tex]Power = \frac{ energy}{time}[/tex]

plugging all value and solve for time

[tex]time = \frac{energy}{power}[/tex]

[tex]time = \frac{9400}{0.5}[/tex]

time = 18,800 sec

in hour

1 hour = 3600 sec

therefore in 18,800 sec

[tex]time = \frac{18800}{3600} = 5.22 hr[/tex]

The net potential energy between two adjacent ions, EN, may be represented by EN = -A/r + B/rn Where A, B, and n are constants whose values depend on the particular ionic system. Calculate the bonding energy E0 in terms of the parameters A, B, and n using the following procedure: 1. Differentiate EN with respect to r, and then set the resulting expression equal to zero, since the curve of EN versus r is a minimum at E0. 2. Solve for r in terms of A, B, and n, which yields r0, the equilibrium interionic spacing. 3. Determine the expression for E0 by substitution of r0 into the above equation for EN. What is the equation that represents the expression for E0?

Answers

The  equation that represents the expression for the bonding energy [tex](E_0\))[/tex] in terms of the parameters A, B, and n is: [tex]\[ E_0 = -\frac{A^{\frac{n-1}{n}}}{(nB)^{\frac{1}{n}}} + \frac{1}{n} \][/tex].

Step 1: Differentiate EN with Respect to r

Given:

[tex]\[ E_N = -\frac{A}{r} + \frac{B}{r^n} \][/tex]

Differentiate [tex]\(E_N\)[/tex] with respect to r:

[tex]\[ \frac{dE_N}{dr} = \frac{A}{r^2} - \frac{nB}{r^{n+1}} \][/tex]

Set the derivative equal to zero to find the minimum (equilibrium) point:

[tex]\[ \frac{A}{r^2} - \frac{nB}{r^{n+1}} = 0 \][/tex]

Solve for r as

[tex]\[ \frac{A}{r^2} = \frac{nB}{r^{n+1}} \][/tex]

[tex]\[ r^n = \frac{nB}{A} \][/tex]

[tex]\[ r = \left(\frac{nB}{A}\right)^{\frac{1}{n}} \][/tex]

Step 2: Solve for r in terms of A, B, and n

The equilibrium interionic spacing [tex]\(r_0\)[/tex] is the value of r at the minimum point,

[tex]\[ r_0 = \left(\frac{nB}{A}\right)^{\frac{1}{n}} \][/tex]

Step 3: Determine the Expression for E0

Substitute [tex]\(r_0\)[/tex] into the expression for [tex]\(E_N\):[/tex]

[tex]\[ E_0 = -\frac{A}{r_0} + \frac{B}{r_0^n} \][/tex]

[tex]\[ E_0 = -\frac{A}{\left(\frac{nB}{A}\right)^{\frac{1}{n}}} + \frac{B}{\left(\frac{nB}{A}\right)^{\frac{n}{n}}} \][/tex]

Simplify:

[tex]\[ E_0 = -\frac{A^{\frac{n-1}{n}}}{(nB)^{\frac{1}{n}}} + \frac{B}{(nB)^{\frac{n}{n}}} \][/tex]

[tex]\[ E_0 = -\frac{A^{\frac{n-1}{n}}}{(nB)^{\frac{1}{n}}} + \frac{B}{nB} \][/tex]

[tex]\[ E_0 = -\frac{A^{\frac{n-1}{n}}}{(nB)^{\frac{1}{n}}} + \frac{1}{n} \][/tex]

Combine the terms:

[tex]\[ E_0 = -\frac{A^{\frac{n-1}{n}}}{(nB)^{\frac{1}{n}}} + \frac{1}{n} \][/tex]

So, the equation is [tex]\[ E_0 = -\frac{A^{\frac{n-1}{n}}}{(nB)^{\frac{1}{n}}} + \frac{1}{n} \][/tex].

Learn more about Equilibrium here:

https://brainly.com/question/30694482

#SPJ12

Five kg of water is contained in a piston-cylinder assembly, initially at 5 bar and 300°C. The water is slowly heated at constant pressure to a final state. The heat transfer for the process is 3560 kJ and kinetic and potential energy effects are negligible.
Determine the final volume, in m3, and the work for the process, in kJ.

Answers

Final answer:

To determine the final volume and work done during the heating of water in a piston-cylinder assembly at constant pressure, tabulated data like steam tables are required since water is not an ideal gas. The work done is calculated using the formula W = PΔV.

Explanation:

The student has been asked to find the final volume and the work done during a constant pressure process in which 5 kg of water is heated in a piston-cylinder assembly from an initial state of 5 bar and 300°C. To solve for the final volume and work done, one would typically use the first law of thermodynamics, which states that the change in internal energy of a system is equal to the heat input minus the work output. However, since water at this state is not an ideal gas, tabulated data from steam tables or software would be used to determine the specific volume at the final state and then multiplied by the mass to find the total volume. The work done in a constant pressure process is equal to the pressure times the change in volume (W = PΔV). Without the final specific volume from the tables, we cannot compute the final volume or work directly.

Consider a steady flow Carnot cycle with water as the working fluid. The maximum and minimum temperatures in the cycle are 350 and 50 C. The quality of water is 0.891 at the beginning of the heat rejection process and 0.1 at the end. Determine:

(a) the thermal efficiency (how much percent).
(b) the pressure at the turbine inlet, and
(c) the network output

a) Etath,C= %
b) P2=MPa
c) wnet = kJ/kg

Answers

Answer:

a) Etath = 48.2 %

b) P2 = 1.195 MPa

c) wnet = 1749.14 KJ/kg

Explanation:

Given:

T1 = T2 = 50 , TL = 50 + 273 = 323 K

T3 = T4 = 350 , TH = 350 + 273 = 623 K

x3 =0.891

x4 = 0.1

Part a

Thermal efficiency (Etath) of carnot cycle is:

Etath = 1 - (TL / TH )

Etath = 1 - (323) / (623) = 48.2 %

Part b

Note:

From A - 4 Table

T1 = 50 C @sat

sf = 0.7038 KJ/kg.K

sfg = 7.3710 KJ/Kg.K

s2 = s3 = sf + x3 * (sfg)

s2 = s3 = 0.7038 + 0.891*7.3710 = 7.271361 KJ/kg.K

Thus,

@ T2 = 350 C  ; sg = 5.2114 KJ/kg.K

s2 = 7.271361 KJ/kg.K

s2 > sg@T = 350 C, hence super-heated region.

Use Table A-6

T2 = 350 C

s2 = 7.271361 KJ/kg.K

P2 = 1.195 MPa (using interpolation)

part c

wnet can be calculated by finding the enclosed area on a T-s diagram:

s4= sf + x4*sfg =  0.7038 + 0.1*7.3710 = 1.4409 KJ/kg.K

wnet = (TH - TL)*(s3 - s4)

wnet = (623 - 223) * (7.271361 - 1.4409) = 1749.14 KJ/kg

A glass window pane, 1 m wide, 1.5 m high, and 5 mm thick, has a thermal conductivity of kg = 1.4 W/(m∙K). On a cold winter day, the indoor and outdoor temperatures are 15 °C and −25 °C respectively. (a) For a single-pane window at steady state, what is the rate of heat transfer through the glass? (10 pts) (b) To reduce heat loss through windows, it is customary to use a double pane construction in which adjoining panes are separated by a dead-air space. The thermal conductivity of air is ka = 0.024 W/(m∙K). If the spacing between the two glasses is 10 mm. Calculate the temperatures of the glass surfaces in contact with the dead-air at the steady state. (10 pts) (c) Calculate the heat loss through the double-pane window in (b). (5 pts)

Answers

Answer:

a) Rate of heat transfer = 16.8KW

b) Temperature of glass surface = 15degree Celsius

c) Heat loss through frame = 141.34W

Explanation:

The concept used to approach this question is the Fourier's law of head conduction postulated by Joseph Fourier. it states that the rate of heat flow through a single homogeneous solid is directly proportional to the area and to the direction o heat flow and to the change in temperature with respect to the path length. Mathematically,

Q = -KA dt/dx

The detailed and step by step calculation is attached below

In each case indicate whether the quantity in question increased, decreased or stayed the same when the string length is increased. Assume that the tension is unchanged. The function generator is kept at the same frequency, and the string is in resonance in all cases. Part A Number of antinodes ___ Number of antinodes ___ increased. decreased. stayed the same. Request Answer Part B Wavelength ___ Wavelength ___ increased. decreased. stayed the same. Request Answer Part C Fundamental frequency ___ Fundamental frequency ___ increased. decreased. stayed the same.

Answers

Answer:

Answer: No of anti-nodes increases

Answer: wavelength remains same.

Answer: fundamental frequency decreases

Explanation:

a)

The number of nodes (n) would have (n-1) anti-nodes.

The relation of Length of string with n is given below:

[tex]L = \frac{n*lambda}{2}[/tex]

Hence, n and L are directly proportional so as string length increases number of nodes and anti-nodes also increases.

Answer: No of anti-nodes increases

b)

Wavelength is dependent on the frequency:

[tex]lambda = \frac{v}{f}[/tex]

The speed v of the string remains same through-out and frequency of generator is unchanged!

Hence according to above relationship lambda is unchanged.

Answer: wavelength remains same.

C

Fundamental frequency equates to 1st harmonic that 2 nodes and 1 anti-node. Wavelength is = 2*L

Hence, if L increases wavelength increases

Using relation in part b

As wavelength increases fundamental frequency decreases

Answer: fundamental frequency decreases

The idling engines of a landing turbojet produce forward thrust when operating in a normal manner, but they can produce reverse thrust if the jet is properly deflected. Suppose that while the aircraft rolls down the runway at 150 km/h the idling engine consumes air at 50 kg/s and produces an exhaust velocity of 150 m/s.

a. What is the forward thrust of this engine?
b. What are the magnitude and direction (i.e., forward or reverse) if the exhaust is deflected 90 degree without affecting the mass flow?
c. What are the magnitude and direction of the thrust (forward or reverse) after the plane has come to a stop, with 90 degree exhaust deflection and an airflow of 40 kg/s?

Answers

Answer:

T = 5416.67 N

T = -2083.5 N

T = 0

Explanation:

Forward thrust has positive values and reverse thrust has negative values.

part a

Flight speed u = ( 150 km / h ) / 3.6 = 41.67 km / s

The thrust force represents the horizontal or x-component of momentum equation:

[tex]T = flow(m_{exhaust})*(u_{exhaust} - u_{flight} )\\T = (50 kg/s ) * (150 - 41.67)\\\\T = 5416.67 N[/tex]

Answer: The thrust force T = 5416.67 N

part b

Now the exhaust velocity is now vertical due to reverse thrust application, then it has a zero horizontal component, thus thrust equation is:

[tex]T = flow(m_{exhaust})*(u_{exhaust} - u_{flight} )\\T = (50 kg/s ) * (0 - 41.67)\\\\T = -2083.5 N[/tex]

Answer: The thrust force T = -2083.5 N reverse direction

part c

Now the exhaust velocity and flight velocity is zero, then it has a zero horizontal component, thus thrust is also zero as there is no difference in two velocities in x direction.

Answer: T = 0 N

The cart travels the track again and now experiences a constant tangential acceleration from point A to point C. The speeds of the cart are 13.2 ft/sft/s at point A and 17.6 ft/sft/s at point C. The cart takes 3.00 ss to go from point A to point C, and the cart takes 1.90 ss to go from point B to point C. What is the car's speed at point B?

Answers

Answer:

15.99 ft/s

Explanation:

From Newton's equation of motion, we have

v = u + at

v = Final speed

u = initial speed

a = acceleration

t = time

now

for the points A and C

v = 17.6 ft/s

u = 13.2 ft/s

t = 3 s

thus,

17.6 = 13.2 + a(3)

or

3a = 17.6 - 13.2

3a = 4.4

or

a = 1.467 m/s²

Thus,

For Points A and B

v = speed at B i.e v'

u = 13.2 ft/s

a = 1.467 ft/s²

t = 1.90 s

therefore,

v' = 13.2 + (1.467 × 1.90 )

v' = 13.2  + 2.7867

v' = 15.9867 ≈ 15.99 ft/s

If the electric field just outside a thin conducting sheet is equal to 1.5 N/C, determine the surface charge density on the conductor.

Answers

Answer:

The surface charge density on the conductor is found to be 26.55 x 1-6-12 C/m²

Explanation:

The electric field intensity due to a thin conducting sheet is given by the following formula:

Electric Field Intensity = (Surface Charge Density)/2(Permittivity of free space)

From this formula:

Surface Charge Density = 2(Electric Field Intensity)(Permittivity of free space)

We have the following data:

Electric Field Intensity = 1.5 N/C

Permittivity of free space = 8.85 x 10^-12 C²/N.m²

Therefore,

Surface Charge Density = 2(1.5 N/C)(8.85 x 10^-12 C²/Nm²)

Surface Charge Density = 26.55 x 10^-12 C/m²

Hence, the surface charge density on the conducting thin sheet will be 26.55 x 10^ -12 C/m².

The surface charge density on the conductor is; σ = 13.275 × 10⁻¹² C/m²

What is the surface charge density?

The formula for surface charge density on a conductor in an electric field just outside the surface of conductor is;

σ = E * ϵ₀

​where;

E is electric field = 1.5 N/C

ϵ₀ is permittivity of space = 8.85 × 10⁻¹² C²/N.m²

Thus;

σ = 1.5 * 8.85 × 10⁻¹²

σ = 13.275 × 10⁻¹² C/m²

Read more about Surface Charge Density at; https://brainly.com/question/14306160

A sample of coarse aggregate has an oven dry weight of 1034.0 g and a moisture content of 4.0 %. The saturated surface dry weight is 1048.9g and the weight of the aggregate in water is 675.6 g. Determine using phase volume relationships: a) Apparent Specific Gravity (GA) b) Bulk Specific Gravity (GB) c) Bulk Specific Gravity SSD (GB (SSD)) d) Absorption, % e) Bulk Volume

Answers

Answer:

Apparent Specific Gravity = 2.88

bulk specific gravity = 2.76

Bulk Specific Gravity SSD  = 2.80

absorption = 1.44%

bulk volume  = 373.3

Explanation:

given data

oven dry weight A  = 1034.0 g

moisture content = 4.0 %

saturated surface dry weight B = 1048.9 g

weight of the aggregate in water C = 675.6 g

solution

we get here Apparent Specific Gravity that is express as

Apparent Specific Gravity = [tex]\frac{A}{A-C}[/tex]   ..........1

put here value

Apparent Specific Gravity = [tex]\frac{1034}{1034-675.6}[/tex]

Apparent Specific Gravity = 2.88

and

now we get bulk specific gravity that is

bulk specific gravity = [tex]\frac{A}{B-C}[/tex]   ...................2

put here value

bulk specific gravity = [tex]\frac{1034}{1048.9-675.6}[/tex]

bulk specific gravity = 2.76

and

now we get Bulk Specific Gravity SSD

Bulk Specific Gravity SSD = [tex]\frac{B}{B-C}[/tex]    ............3

Bulk Specific Gravity SSD = [tex]\frac{1048.9}{1048.9-675.6}[/tex]

Bulk Specific Gravity SSD  = 2.80

and

now absorption will be here as

absorption = [tex]\frac{B-A}{A}[/tex] × 100%    ................4

absorption = [tex]\frac{1048.9-1034}{1034}[/tex] × 100%

absorption = 1.44%

and

last we get bulk volume that is

bulk volume = [tex]\frac{weight\ displce\ water}{density\ water }[/tex]

bulk volume = [tex]\frac{1048.9-675.6}{1}[/tex]

bulk volume  = 373.3

Consider a point in a structural member that is subjected to plane stress. Normal and shear stress magnitudes acting on horizontal and vertical planes at the point are Sx = 175 MPa, Sy = 90 MPa, and Sxy = 75 MPa.

Answers

Answer:

C = 132.5 MPa

R = 86.20 MPa

Explanation:

Given

σx = 175 MPa

σy = 90 MPa

τxy = 75 MPa

For the given state of stress at a point in a structural member, determine the center C and the radius R of Mohr’s circle.

We apply the following equation for the center C

C = (σx + σy) / 2

C = (175 MPa + 90 MPa) / 2

C = 132.5 MPa

The Radius can be obtained as follows

R = √(((σx - σy) / 2)² + (τxy)²)

R = √(((175 MPa - 90 MPa) / 2)² + (75 MPa)²)

R = 86.20 MPa

Write IEEE floating point representation of the following decimal number. Show your work.
1.25

Answers

Answer:

00111111101000000000000000000000

Explanation:

View Image

0   01111111   01000000000000000000000

The first bit is the sign bit. It's 0 for positive numbers and 1 for negative numbers.

The next 8-bits are for the exponents.

The first 0-126₁₀ (0-2⁷⁻¹) are for the negative exponent 2⁻¹-2⁻¹²⁶.

And the last 127-256₁₀ (2⁷-2⁸) are for the positive exponents 2⁰-2¹²⁶.

You have 1.25₁₀ which is 1.010₂ in binary. But IEEE wants it in scientific notation form. So its actually 1.010₂*2⁰

The exponent bit value is 127+0=127 which is 01111111 in binary.

The last 23-bits are for the mantissa, which is the fraction part of your number. 0.25₁₀ in binary is 010₂... so your mantissa will be:

010...00000000000000000000

In a residential heat pump, Refrigerant-134a enters the condenser at 800 kPa and 50oC at a rate of 0.022 kg/s and leaves at 750 kPa subcooled by 3oC. The refrigerant enters the compressor at 200 kPa superheated by 4oC. Determine (a) the isentropic efficiency of the compressor, (b) the rate of heat supplied to the heated room, and (c) the COP of the heat pump. Also, (d) determine the COP and the rate of heat supplied to the heated room if this heat pump operated on the ideal vapor-compression cycle between the pressure limits of 200 kPa and 800 kPa.

Answers

Answer:

a) 0.813

b) 4.38 KW

c) COP = 5.13

d) 3.91 KW , COP = 6.17

Explanation:

Data obtained A-13 tables for R-134a:

[tex]h_{1} = 247.88 \frac{KJ}{kg} \\s_{1} = 0.9575 \frac{KJ}{kgK}\\h_{2s} = 279.45 \frac{KJ}{kg}\\h_{2} = 286.71 \frac{KJ}{kg}\\h_{3} = 87.83 \frac{KJ}{kg}[/tex]

The isentropic efficiency of the compressor is determined by :

[tex]n_{C} = \frac{h_{2s} - h_{1} }{h_{2} - h_{1} }\\= \frac{279.45 - 247.88 }{286.71 - 247.88}\\= 0.813[/tex]

The rate of heat supplied to the room is determined by heat balance:

[tex]Q = m(flow) * (h_{2} -h_{3})\\= (0.022)*(286.71 - 87.83)\\\\= 4.38KW[/tex]

Calculating COP

[tex]COP = \frac{Q_{H} }{W} \\COP = \frac{Q_{H} }{m(flow) * (h_{2} - h_{1}) }\\\\COP = \frac{4.38}{(0.022)*(286.71-246.88)}\\\\COP = 5.13[/tex]

Part D

Data Obtained:

[tex]h_{1} = 244.5 \frac{KJ}{kg} \\s_{1} = 0.93788 \frac{KJ}{kgK}\\h_{2} = 273.31 \frac{KJ}{kg}\\h_{3} = 95.48 \frac{KJ}{kg}[/tex]

The rate of heat supplied to the room is determined by heat balance:

[tex]Q = m(flow) * (h_{2} -h_{3})\\= (0.022)*(273.31 - 95.48)\\\\= 3.91KW[/tex]

Calculating COP

[tex]COP = \frac{Q_{H} }{W} \\COP = \frac{Q_{H} }{m(flow) * (h_{2} - h_{1}) }\\\\COP = \frac{4.38}{(0.022)*(273.31-244.5)}\\\\COP = 6.17[/tex]

Explain the differences among sand, silt, and clay, both in their physical characteristics and their behavior in relation to building foundations.

Answers

Answer:PHYSICALLY- sand is spherical in shape with large particles up to 0.18g

Silt also contains more of spherical particles with weights around 0.0029g.

Clay contain plate like particles,which are flat or layered. It's particles are generally lower that silt and sand below 0.0029g.

BEHAVIORS Sand particles are coarse and very porous,water can easily penetrate with no particles cohesion,does not retain water, difficult to expand,it is IDEAL FOR BUILDINGS.

Silt particles are also porous with some coarseness and no particles cohesion. retains water and can expand. NOT IDEAL FOR BUILDINGS.

Clay contain particles that are not coarse,they have high cohesiveness,they are not porous as it is difficult for water to penetrate. NOT IDEAL FOR BUILDINGS.

Explanation: Sand particles are coarse,very porous,contains spherical particles with large particles sizes and IDEAL FOR BUILDINGS

Silt particles are also porous, with some coarseness and with little or no particles cohesion, NOT IDEAL FOR BUILDINGS.

Clay soils are not porous water can not easily flow thought it,it is hard when dry and soft when wet. IT IS NOT A GOOD OPTION FOR BUILDINGS.

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

Answers

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 = "!@#$%^&*(";

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

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

              return true;

      return false;

  }

}

The gage pressure in a liquid at a depth of 3 m is read to be 48 kPa. Determine the gage pressure in the same liquid at a depth of 9 m.
The gage pressure in the same liquid at a depth of 9 m is__________ kPa.

Answers

Answer: 144kpa

Explanation:

pressure density =p

The Gage pressure (P1)=48kpa

The height (h1)=3m

The Gage pressure (P2)=?

The height (h2)=9m

P=p * g * h

P1/P2=p * g * h1/p * g * h2

Cancelling out similar terms:

Therefore, P1/P2=h1/h2

P2=P1*h2/h1

Hence, P2=48*9/3=144kpa.

A) Fix any errors to get the following program to run in your environment. B) Document each line of code with comments and describe any changes you had to make to the original code to get it to work. C) Write a summary of what your final version of the program does.

You may also add white space or reorder the code to suit your own style as long as the intended function does not change.

#include
using namespace std;

void m(int, int []);
void p(const int list[], int arraySize)
{
list[0] = 100;
}

int main()
{
int x = 1;
int y[10];
y[0] = 1;

m(x, y);

cout << "x is " << x << endl;
cout << "y[0] is " << y[0] << endl;

return 0;
}

void m(int number, int numbers[])
{
number = 1001;
numbers[0] = 5555;
}

Answers

Answer:

Answer is explained below

Explanation:

Part A -:

Error statement -:

/*

prog.cpp: In function ‘void p(const int*, int)’:

prog.cpp:7:15: error: assignment of read-only location ‘* list’

list[0] = 100;

*/

There is one error in the code in following part

void p( const int list[], int arraySize)

{

list[0] = 100;

}

you are passing list as constant but changing it inside the function that is not allowed. if you pass any argument as const then you can't change it inside the function. so remove const from function argument solve the error.

Part B -:

change made

void p( int list[], int arraySize)

{

list[0] = 100;

}

Executable fully commented code -:

#include <iostream> // importing the iostream library

using namespace std;

void m(int, int []); // Function declearation of m

void p( int list[], int arraySize) // definition of Function p

{

list[0] = 100; // making value of first element of list as 100

}

int main()

{

int x = 1; // initilizing x with 1

int y[10]; // y is a array of 10 elements

y[0] = 1; // first element of y array is 1

m(x, y); // call m function

// printing the desired result

cout << "x is " << x << endl;

cout << "y[0] is " << y[0] << endl;

return 0;

}

void m(int number, int numbers[]) // Function definition of m

{

number = 1001; // value of number is 1001 locally

numbers[0] = 5555; // making value of first element of numbers array 5555

}

Part C :-

In program we initilize x with value 1 and create an array y of 10 elements.

we initilize the y[0] with 1\

then we call function m. In function m ,first argument is value of x and second argument is the pointer to the first element of array y.

so value of x is changed locally in function m and change is not reflected in main function.

but value of y[0] is changed to 5555 because of pass by refrence.

So we are getting the following result :-

x is 1

y[0] is 5555

If a barrel of oil weighs 1.5 kN, calculate the specific weight, density, and specific gravity of the oil. The barrel weighs 110 N

Answers

Answer

given,

oil barrel weight  = 1.5 k N = 1500 N

weight of the barrel = 110 N

Assuming volume of barrel = 0.159 m³

weight of oil = 1500-110

                     = 1390 N

[tex]specific\ weight = \dfrac{weight}{volume}[/tex]

[tex]specific\ weight = \dfrac{1390}{0.159}[/tex]

            = 8742.14 N/m³

[tex]mass = \dfrac{weight}{g}[/tex]

[tex]mass = \dfrac{1390}{9.8}[/tex]

              = 141.84 kg

[tex]density = \dfrac{mass}{volume}[/tex]

[tex]density = \dfrac{141.84}{0.159}[/tex]

                    = 892.05 kg/m³

[tex]Specific\ gravity = \dfrac{density\ of\ oil}{density\ of\ water}[/tex]

[tex]Specific\ gravity = \dfrac{892.05}{1000}[/tex]

                    = 0.892

A harmonic oscillator with spring constant, k, and mass, m, loses 3 quanta of energy, leading to the emission of a photon.

a. What is the energyon in terms of k adm
b. If the oscillator is a bonded atom with k = 15 N/m and m = 4 × 10-26 kg, what is the frequency (Hz) of the emitted photon? (Note: the energy of a photon is Ephoton= hf)
c. In which region of the electromagnetic spectrum (x-ray, visible, microwave, etc.) does this photon belong?

Answers

Final answer:

The answer explains the energy of a quantum harmonic oscillator, calculates the frequency of an emitted photon, and identifies the region of the electromagnetic spectrum it belongs to.

Explanation:

a. Energy: The energy of a quantum harmonic oscillator can be represented as En = (n+1/2)h(sqrt(k/M)), where n = 0,1,2... and h represents Planck's constant.

b. Frequency Calculation: Using the given values of k = 15 N/m and m = 4 x 10^-26 kg, you can calculate the frequency of the emitted photon using the formula w = sqrt(k/M)/(2pi).

c. Electromagnetic Spectrum: To determine the region of the electromagnetic spectrum the photon belongs to, compare the frequency calculated to the known ranges of various regions like x-ray, visible, and microwave.

A cylindrical part of diameter d is loaded by an axial force P. This causes a stress of P/A, where A = πd2/4. If the load is known with an uncertainty of ±11 percent, the diameter is known within ±4 percent (tolerances), and the stress that causes failure (strength) is known within ±20 percent, determine the minimum design factor that will guarantee that the part will not fail.

Answers

Answer:

1.505

Explanation:

cylindrical part of diameter d is loaded by an axial force P. This causes a stress of P/A, where A = πd2/4. If the load is known with an uncertainty of ±11 percent, the diameter is known within ±4 percent (tolerances), and the stress that causes failure (strength) is known within ±20 percent, determine the minimum design factor that will guarantee that the part will not fail.

stress is force per unit area

stress=P/A

A = πd^2/4.

uncertainty of axial force P= +/-.11

s=+/-.20, strength

d=+/-.04 diameter

fail load/max allowed

minimum design=fail load/max allowed

minimum design =s/(P/A)

sA/P

A=([tex]\pi[/tex].96d^2)/4, so Amin=

[tex]0.96^{2}[/tex] (because the diameter  at minimum is (1-0.04=0.96)

minimum design=Pmax/(sminxAmin)

1.11/(.80*.96^2)=

1.505

Determine the percent increase in the nominal moment capacity of the section in Problem 2 when including compression steel at top equal to 0.5 the area of the tension steel at the bottom.

Answers

Explanation:

Please kindly share your problem two with us as to know the actual problem we are dealing with, the question looks incomplete

a 100mh inductor is placed parallel with a 100 ohm resistor in the circuit , the circuit has a source voltage of 30 vac and a frequancy of 200 Hz what is the current through the inductor

Answers

Answer:

current through the inductor  = 0.24 A

Explanation:

given data

inductor = 100mh

resistor = 100 ohm

voltage = 30 vac

frequancy = 200 Hz

to find out

current through the inductor

solution

current through the inductor will be when inductor is place parallel with resistor

across resistor

XL = i2πl

XL = i2π×200×100×[tex]10^{-3}[/tex] = i126.66

so

current through the inductor = [tex]\frac{voltage}{XL}[/tex]

current through the inductor = [tex]\frac{30}{125.66}[/tex]

current through the inductor  = 0.24 A

(1 point) Consider the initial value problem 2????y′=4y, y(−1)=−2. Find the value of the constant ???? and the exponent ???? so that y=???????????? is the solution of this initial value problem. y= help (formulas) Determine the largest interval of the form ????<????<???? on which the existence and uniqueness theorem for first order linear differential equations guarantees the existence of a unique solution. help (inequalities) What is the actual interval of existence for the solution (from part a)? help (inequalities)

Answers

Answer:

Here is the missing part of the question ;

find the value of the constant C and the exponent r so that y = Ctr is the solution of this initial value problem. Determine the largest interval of the form a<t<b

Explanation:

The step by step explanation is as given in the attachment. You will notice I used β as the exponential in place of r.

My Notes How many grams of perchloric acid, HClO4, are contained in 39.1 g of 74.9 wt% aqueous perchloric acid?
How many grams of water are in the same solution?

Answers

Answer:

a)29.9 b) 9.81

Explanation:

Wt% = mass of solute / mass of solvent × 100

0.749 = mass of solute / mass of solvent

a) Mass of perchloric acid = 0.749 × 39.1 = 29.29

b) Mass of water = 39.1 - 29.29 = 9.81

It is possible to maintain a pressure of 10 kPa in a condenser that is being cooled by river water entering at 20 °C?

Answers

Answer:

Yes, it is possible to maintain a pressure of 10 kPa in a condenser that is being cooled by river water that is entering at 20 °C because this temperature (20 °C) of the external cooling water is less than the saturation temperature of steam which is which is 45.81 °C, and heated by a boiler; as a result of this condition, coupled with the assumption that the turbine, pump, and interconnecting tube are adiabatic, and the condenser exchanges its heat with the external cooling river water, it possible to maintain a pressure of 10 kPa.

Electrical failure can lead to ________failure, which in turn can lead to software failure.

Answers

Answer:

Electrical failure can lead to _hardware__failure, which in turn can lead to software failure

Consider steady one-dimensional heat conduction through a plane wall, a cylindrical shell, and a spherical shell of uniform thickness with constant thermophysical properties and no thermal energy generation. The geometry in which the variation of temperature in the direction of heat transfer will be linear is (a) Cylindrical wall (b) Plane shell (c) Spherical shell (d) All of them (e) None of them

Answers

Answer:

Plane shell which is option b

Explanation:

The temperature in the case of a steady one-dimensional heat conduction through a plane wall is always a linear function of the thickness. for steady state dT/dt = 0

in such case, the temperature gradient dT/dx, the thermal conductivity are all linear function of x.

For a plane wall, the inner temperature is always less than the outside temperature.

Design a sequential circuit with two D flip-flops A and B, and one input x_in.



(a)When xin = 0, the state of the circuit remains the same. When x_in = 1, the circuit goes through the state transitions from 00 to 01, to 11, to 10, back to 00, and repeats.



(b)When xin = 0, the state of the circuit remains the same. When x_in =1, the circuit goes through the state transitions from 00 to 11, to 01, to 10, back to 00, and repeats.

Answers

Answer:

View Image

Explanation:

The question is basically asking you to build a 2-bit asynchronous counter.

What the counter does is it increase it's value by 01₂ every clock pulse. So at 0₂, nothing happens, but at 1₂ it'll count up by 1. It then reset to 00₂ when it overflows.

The design for it is pretty much universal so I kinda did this from memory.

a.) A count-up counter (from 00-11) is simply made by connecting Q' to D, and the output of the previous DFF to the clock of the next one.

b.) A count-down counter (from 11-00) is simply made by using the same circuit as the count-up counter, but you connect Q' to the clock instead of Q.

Other Questions
state the function of each of the following DNA,fat and sugar.Classify each of them into the group of organic compounds to which they belong The major part of the average exposure of humans to radiation comes from_____________.a. other human made sources.b. naturally occurring sources.c. diagnostic x-rays.d. nuclear power plants need this asap no rocky If it snows tomorrow, the probability is 0.9 that John will practice his trombone. If it does not snow tomorrow, there is on a 0.5 chance that John will practice. Suppose the chance of snow tomorrow is 50%. What is the probability that John will practice his trombone? one satellite radio station service charges $10 per month plus an activation fee of $20. A second service charges $11 per month plus an activation fee of $15. In what month will the cost of both plans be the same? What is the value of the following expression 1.8 + 0.5(y + 6) - 2 t the power of 3 when y = 14? PLEASE HELP!!!! Which of the following would be a possible solution to the system of inequalities given below? An albino woman has 8 children with the same ma. 5 of which are albino. What is the fathers genotype? An object's velocity in m/s is given by the equation vx(t) = 10t-2. If it starts at x=0 at t=0, what is its position after 5 seconds? What do you have as an entrepreneur when buyers choose your products or services over your competitors?As an entrepreneur, you have a ___ when buyers choose your products or services over your competitors. 1.Native Americans have a strong connection to the natural world which can be seen in their various stories of Earths creation. Describe some of the references the Salinan and Cherokee Creation stories provide to the natural world. A(n) 10.7 g bullet is shot into a(n) 4588 g wooden block standing on a frictionless surface. The block, with the bullet in it, acquires a speed of 1.74 m/s. Calculate the speed of the bullet before striking the block. Answer in units of m/s What are the 3 ingredients needed for infants (and children too) to learn according to NCTM? (p. 2) Choisissez la bonne rponse.David, as-tu fait tes devoirs ?Oui, je l'ai fait.Oui, je les ai fait.Oui, je les ai faits. There are 5 very different seats in a car. In how many ways can 5 different people be seated in the car for a road trip if only 2 of them know how to drive? This detail supports the central idea that riches are not important to Utopians. It is best described as a(n) fact. a.analogy. b.anecdote. c.example. without doing any calculations or modeling, explain how you know that the 24 inch by 32 inch mirror and the 20 inch by 32 inch mirror are not similar. Explain A new penny has a mass of 2.49 grams and occupies 0.349 cm cubed. If pure copper has a density of 8.96 g/cm cubed, is the new penny put copper? Assume a color display using 8 bits for each of the primary colors (red, green, blue) per pixel and a frame size of 1280 1024. What is the minimum size in bytes of the frame buffer to store a frame? Scott and Andy provide support and learning opportunities, coach, and guide their employees. Andy and Scott discuss their approach at Barcelona as one that is empowering. "This is your restaurant," Andy tells new managers. Scott says, "I think youre limiting your ability to get better," when you tell managers what to do.Scott and Andys empowering view of management is most closely related to which management theory?a. Behavioral management perspectiveb. Classical management perspectivec. Quantitative management perspectived. Scientific management perspective Steam Workshop Downloader