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
The host at the end of the video claims that ___________ is crucial to his success as a driver. A. Reaction time B. A safe space
Snezhnost [94]

Answer:

answer is C. his seat belt

5 0
2 years ago
A horizontal curve on a two-lane road is designed with a 2,300-ft radius, 12-ft lanes, and a 65-mph design speed. Determine the
Ierofanga [76]

Answer:

distance = 22.57 ft

superelevation rate = 2%

Explanation:

given data

radius = 2,300-ft

lanes width = 12-ft

no of lane = 2

design speed = 65-mph

solution

we get here sufficient sight distance SSD that is express as

SSD = 1.47 ut + \frac{u^2}{30(\frac{a}{g}\pm G)}     ..............1

here u is speed and t is reaction time i.e 2.5 second and a is here deceleration rate i.e 11.2 ft/s² and g is gravitational force i.e 32.2 ft/s² and G is gradient i.e 0 here

so put here value and we get

SSD = 1.47 × 65 ×2.5  + \frac{65^2}{30(\frac{11.2}{32.2}\pm 0)}

solve it we get

SSD = 644 ft  

so here minimum distance clear from the inside edge of the inside lane is

Ms = Rv ( 1  - cos (\frac{28.65 SSD}{Rv}) )        .....................2

here Rv is = R - one lane width

Rv = 2300 - 6 = 2294 ft

put value in equation 2 we get

Ms = 2294 ( 1  - cos (\frac{28.65 \times 664}{2294})  )  

solve it we get

Ms = 22.57 ft

and

superelevation rate for the curve will be here as

R  = \frac{u^2}{15(e+f)}  ..................3

here f is coefficient of friction that is 0.10

put here value and we get e

2300 = \frac{65^2}{15(e+0.10)}

solve it we get

e = 2%

3 0
3 years ago
The AGC control voltage: ___________
lyudmila [28]

Answer:

The AGC circuit operates with an input voltage range of 60 dB (5 mV p-p to 5 V p-p), with a fixed output voltage of 250 mV p-p.

Explanation:

3 0
2 years ago
Which of the following is NOT true about hydraulic valves? A. Directional control valves determine the path of a fluid in a give
Lelechka [254]

Answer: Option D is not true of hydraulic valves. A hydraulic valve is a device that can change the opening degree of liquid flow path

Explanation:

The pilot check valve allows flow of liquid in one direction and blocks flow in the opposite direction

5 0
3 years ago
Omg help mr idk what to say ahhh​
kap26 [50]

Explanation:

ответ на фото !!!!!!

7 0
3 years ago
Read 2 more answers
Other questions:
  • A tire-pressure monitoring system warns you with a dashboard alert when one of your car tires is significantly under-inflated.
    6·1 answer
  • In C++ the declaration of floating point variables starts with the type name float or double, followed by the name of the variab
    14·1 answer
  • A steam power plant operates on an ideal Rankine cycle with two stages of reheat and has a net power output of 120 MW. Steam ent
    14·1 answer
  • A capillary tube is immersed vertically in a water container. Knowing that water starts to evaporate when the pressure drops bel
    11·1 answer
  • Three single-phase, 10 kVA, 2400/280 V, 60-Hz transformers are connected to form a three-phase, 2400/480 V transformer The equiv
    15·1 answer
  • A long corridor has a single light bulb and two doors with light switch at each door.
    12·1 answer
  • What's the best way to find the load capacity of a crane? Select the best option. Call the manufacturer Ask co-workers Look at t
    8·1 answer
  • The cold drawn AISI 1040 steel bar with 25-mm width and 10-mm thick has a 6- mm diameter thru hole in the center of the plate. T
    10·1 answer
  • Please read and an<br><br> 3. Many Jacks use hydraullc power.<br> A) O True<br> B) O False
    13·1 answer
  • How does energy transition from one form to another as water moves from behind a dam to downstream of a dam?.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!