1answer.
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
Semenov [28]
4 years ago
9

Using a conditional expression, write a statement that increments num_users if update_direction is 3, otherwise decrements num_u

sers. Sample output with inputs: 8 3 New value is: 9
Engineering
1 answer:
yuradex [85]4 years ago
6 0

Answer:

num_users = (update_direction == 3) ? (++num_users) : (--num_users);

Explanation:

A. Using the regular if..else statement, the response to the question would be like so;

if (update_direction == 3) {

  ++num_users;  // this will increment num_users by 1

}

else {

 -- num_users;    //this will decrement num_users by 1

}

Note: A conditional expression has the following format;

<em>testcondition ? true : false;</em>

where

a. <em>testcondition </em>is the condition to be tested for. In this case, if update_direction is 3 (update_direction == 3).

b. <em>true </em>is the statement to be executed if the <em>testcondition</em> is true.

c. false is the statement to be executed it the <em>testcondition</em> is false.

B. Converting the above code snippet (the if..else statement in A above) into a conditional expression statement we have;

num_users = (update_direction == 3) ? (++num_users) : (--num_users);

<em>Hope this helps!</em>

You might be interested in
What else will change, if you change the point of view
JulijaS [17]

Answer:

We would need background context,

Explanation:

Then I would be happy to help!

4 0
3 years ago
Design a logic circuit that has a 4-bit binary number as an input and one output. The output should be 1 iffthe input is a prime
Maurinko [17]

Answer:

Check the explanation

Explanation:

Solution

Let the L_1 binary input one A,B,C,D and output is F with L_1 binary inputs we have 16=2^4 combination as in below.

Kindly check the attached image below to get the full step by step explanation to the question above.

5 0
4 years ago
The assembly consists of a brass shell (1) fully bonded to a ceramic core (2). The brass shell [E = 93 GPa, α= 15.1 × 10−6/°C] h
marshall27 [118]

Answer:

ΔT = 62.11°C

Explanation:

Given:

- Brass Shell:

       Inner Diameter d_i = 32 mm

       Outer Diameter d_o = 39 mm

       E_b = 93 GPa

       α_b = 15.1*10^-6 / °C

- Ceramic Core:

       Outer Diameter d_o = 32 mm

       E_c = 310 GPa

       α_c = 3.2*10^-6 / °C

- Unstressed @ T = 8°C

- Total Length of the cylinder L = 160 mm

Find:

Determine the largest temperature increase Δ⁢t that is acceptable for the assembly if the normal stress in the longitudinal direction of the brass shell must not exceed 60 MPa.

Solution:

- Since, α_b > α_c the brass shell is in compression and ceramic core is in tension. The stress in shell is given as б_a:

                              б_b = - 60 MPa

- The force equilibrium can be written as:

                          б_b*A_b + б_c*A_c = 0

Where, б_b is the stress in core

            A_b is the cross sectional area of the shell

            A_c is the cross sectional area of the core

                           б_b*pi*( d_o^2 - d_i^2) / 4  + б_c*pi*( d_i^2) / 4 = 0

                           б_b*( d_o^2 - d_i^2)  + б_c*( d_i^2) = 0

                           б_c = - б_b*( d_o^2 - d_i^2) / ( d_i^2)

Plug in the values:

                           б_c = 60*( 0.039^2 - 0.032^2) / ( 0.032^2)

                           б_c =  29.121 MPa , б_b = - 60 MPa

-  The total strains in both brass shell and ceramic core is given by:

                           ξ_b = α_b*ΔT + б_b / E_b

                           ξ_c = α_c*ΔT + б_c / E_c

- The compatibility relation is:

                           ξ_b = ξ_c

                           α_b*ΔT + б_b / E_b = α_c*ΔT + б_c / E_c

                           ΔT*(α_b - α_c ) = б_c / E_c - б_b / E_b

                           ΔT = [ б_c / E_c - б_b / E_b ] / (α_b - α_c )

Plug in values and solve:

                           ΔT = [ 0.029121 / 310 + 0.06 / 93 ]*10^6 / (15.1 - 3.2 )

                           ΔT = 62.11°C

8 0
3 years ago
Ashrae standard 15 -2013 require that each machinery room activate an alarm and mechanical ventillation?
Kobotan [32]

ASHRAE Standard 15 - 1994 requires that each machinery room must activate an alarm and mechanical ventilation before refrigerant concentrations exceed the TLV-TWA (Threshold Limit Value - Time Weighted Average).

<h3>What is ASHRAE Standard 15 - 1994?</h3>
  • The key standards guiding refrigerant identification and usage developed by ASHRAE have been revised to comply with government regulations and achieve improved performance.
  • Standards 15 and 34 provide critical guidance to manufacturers, design engineers, and operators who must stay up to date on new air conditioning and refrigeration requirements.
  • Standard 34 describes a shorthand method of naming refrigerants and assigns safety classifications based on toxicity and flammability data, whereas Standard 15 establishes procedures for operating equipment and systems when those refrigerants are used.
  • Before refrigerant concentrations exceed the TLV-TWA, each machinery room must activate an alarm and mechanical ventilation, according to ASHRAE Standard 15 - 1994 (Threshold Limit Value - Time Weighted Average).

Therefore, ASHRAE Standard 15 - 1994 requires that each machinery room must activate an alarm and mechanical ventilation before refrigerant concentrations exceed the TLV-TWA (Threshold Limit Value - Time Weighted Average).

Know more about ASHRAE Standard here:

brainly.com/question/14483054

#SPJ4

The correct question is given below:
ASHRAE Standard 15 - 1994 requires that each machinery room must activate an alarm and mechanical ventilation before refrigerant concentrations exceed:

5 0
2 years ago
A small hot surface at temperature Ti-430K having an emissivity 0.8 dissipates heat by radiation into a surrounding area at T2-4
Nat2105 [25]

Answer:

389.6 W/m²

Explanation:

The power radiated to the surroundings by the small hot surface, P = σεA(T₁⁴ - T₂⁴) where σ = Stefan-Boltzmann constant = 5.67 × 10⁻⁸ W/m²-K⁴, ε = emissivity = 0.8. T₁ = temperature of small hot surface = 430 K and T₂ = temperature of surroundings = 400 K

So, P = σεA(T₁⁴ - T₂⁴)

h = P/A = σε(T₁⁴ - T₂⁴)  

Substituting the values of the variables into the equation, we have

h = 5.67 × 10⁻⁸ W/m²-K⁴ × 0.8 ((430 K )⁴ - (400 K)⁴)  

h = 5.67 × 10⁻⁸ W/m²-K⁴ × 0.8 (34188010000 K⁴ - 25600000000 K⁴)  

h = 5.67 × 10⁻⁸ W/m²-K⁴ × 0.8 × 8588010000K⁴

h = 38955213360 × 10⁻⁸ W/m²

h = 389.55213360 W/m²

h ≅ 389.6 W/m²

5 0
3 years ago
Other questions:
  • 1. (5 pts) An adiabatic steam turbine operating reversibly in a powerplant receives 5 kg/s steam at 3000 kPa, 500 °C. Twenty per
    12·1 answer
  • The correct statement about the lift and drag on an object is:_______
    7·2 answers
  • A Charpy V Notch test was conducted for an ASTM A572 Grade 50 bridge steel. The average values of the test results at four diffe
    8·1 answer
  • Alberto's mom is taking a splinter out of his hand with a pair of tweezers. The tweezers are 3 inches long. She is applying .25
    12·2 answers
  • For some transformation having kinetics that obey the Avrami equation (Equation 11.17), the parameter n is known to have a value
    15·1 answer
  • In the following code, determine the values of the symbols here and there. Write the object code in hexadecimal. (Do not predict
    15·1 answer
  • Is there a way to get the answers to a NCCER book test?
    7·1 answer
  • S1.1 The Acre-Foot. Hydraulic engineers in the United States often use, as a unit of volume of water, the acre-foot, defined as
    7·1 answer
  • Please help me in this assignment.
    13·1 answer
  • The rate of flow through an ideal clarifier is 8000m3 /d, the detention time is 1h and the depth is 3m. If a full-length movable
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!