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]
3 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]3 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
Hi,I want to know something.
Paha777 [63]

Answer:

So it looks to me that, Yes, you can find 10-50 leds on Amazon. You just have to be specific and search 10-50 led Christmas lights for windows, or something along those lines. Also try filtering the results, and reading the descriptions and reviews. This should help you out, and if it doesn't then I'm sorry.

Good luck friend :)

8 0
3 years ago
Air pressure is higher above an airfoil.<br> true or false
attashe74 [19]

Answer: true

Explanation:

it flows faster over the top of the wing because the top is more curved than the bottom of the wing. However

6 0
3 years ago
The temperature of an electric welding arc is about?
N76 [4]

Answer:

The heat of the arc melts the surface of the base metal and the end of the electrode. The electric arc has a temperature that ranges from 3,000 to 20,000 °C

Explanation:

Welding fumes are complex mixtures of particles and ionized gases.

7 0
3 years ago
Assume the impedance of a circuit element is Z = (3 + j4) Ω. Determine the circuit element’s conductance and susceptance.
djyliett [7]

Answer:

B. G = 333 mS, B = j250 mS

Explanation:

impedance of a circuit element is Z = (3 + j4) Ω

The general equation for impedance

Z = (R + jX) Ω

where

R = resistance in ohm

X = reactance

R = 3Ω  X = 4Ω

Conductance = 1/R while Susceptance = 1/X

Conductance = 1/3 = 0.333S

= 333 mS

Susceptance = 1/4 = 0.25S

= 250mS

The right option is B. G = 333 mS, B = j250 mS

8 0
3 years ago
A 14 inch diameter pipe is decreased in diameter by 2 inches through a contraction. The pressure entering the contraction is 28
Delicious77 [7]

Answer:

5984.67N

Explanation:

A 14 inch diameter pipe is decreased in diameter by 2 inches through a contraction. The pressure entering the contraction is 28 psi and a pressure drop of 2 psi occurs through the contraction if the upstream velocity is 4.0 ft/sec. What is the magnitude of the resultant force (lbs) needed to hold the pipe in place?

from continuity equation

v1A1=v2A2

equation of continuity

v1=4ft /s=1.21m/s

d1=14 inch=.35m

d2=14-2=0.304m

A1=pi*d^2/4

0.096m^2

a2=0.0706m^2

from continuity once again

1.21*0.096=v2(0.07)

v2=1.65

force on the pipe

(p1A1- p2A2) + m(v2 – v1)

from bernoulli

p1 + ρv1^2/2 = p2 + ρv2^2/2

difference in pressure or pressure drop

p1-p2=2psi

13.789N/m^2=rho(1.65^2-1.21^2)/2

rho=21.91kg/m^3

since the pipe is cylindrical

pressure is egh

13.789=21.91*9.81*h

length of the pipe is

0.064m

AH=volume of the pipe(area *h)

the mass =rho*A*H

0.064*0.07*21.91

m=0.098kg

(193053*0.096- 179263.6* 0.07) + 0.098(1.65 – 1.21)

force =5984.67N

4 0
3 years ago
Other questions:
  • An immersion heater has a resistance of 50Ω and carries a current of 2.5A current. What will be the final temperature of 500 g o
    11·1 answer
  • 2. One of the many methods used for drying air is to cool the air below the dew point so that condensation or freezing of the mo
    12·1 answer
  • Underlining words and highlighting dates are part of a student's personal note taking key.
    6·2 answers
  • A well-established way of power generation involves the utilization of geothermal energy-the energy of hot water that exists nat
    9·1 answer
  • What forced induction device is more efficient?
    8·2 answers
  • Método de Programación lineal utilizado para resolver problemas en teoría de redes?
    15·1 answer
  • IF A CAR AHEAD OF YOU HAS STOPPED AT A CROSSWALK, YOU SHOULD:
    12·1 answer
  • What is true about a point and shoot camera?
    9·1 answer
  • A plant has ten machines and currently operates two 8-hr shift per day, 5 days per week, 50 weeks per year. the ten machines pro
    6·1 answer
  • the left rear brake drum is scored, but the right rear drum looks as good as new. technician a says the left-side drum should be
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!