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
9. Imagine that you're performing measurements on a circuit with a multimeter. You measure a total circuit
ratelena [41]

Answer:

C

Explanation:

the total resistance is equal to the total potential difference divided by the Current

3 0
2 years ago
Read 2 more answers
Select the right answer<br>​
Kruka [31]

Answer:

for 1st question the answer is 5th option.

for 2nd question the answer is 2nd option

hope it helps you mate

please mark me as brainliast

5 0
3 years ago
An electric field is expressed in rectangular coordinates by E = 6x2ax + 6y ay +4az V/m.Find:a) VMN if point M and N are specifi
Fittoniya [83]

Answer:

a.) -147V

b.) -120V

c.) 51V

Explanation:

a.) Equation for potential difference is the integral of the electrical field from a to b for the voltage V_ba = V(b)-V(a).

b.) The problem becomes easier to solve if you draw out the circuit. Since potential at Q is 0, then Q is at ground. So voltage across V_MQ is the same as potential at V_M.

c.) Same process as part b. Draw out the circuit and you'll see that the potential a point V_N is the same as the voltage across V_NP added with the 2V from the other box.

Honestly, these things take practice to get used to. It's really hard to explain this.

3 0
3 years ago
A contractor is planning on including several skylights in each unit of a residential development. What type of worker would she
Sladkaya [172]

Answer:

Glazier

Explanation:

Glaziers are workers who specializes in cutting and installation of glass works.

They work with glass in various surfaces and settings, such as cutting and installing windows and doors, skylights, storefronts, display cases, mirrors, facades, interior walls, etc.

Thus, the type of worker the contractor will hire for this project is a Glazier

8 0
3 years ago
Technician A states that a brake lathe is used to make a used brake rotor surface "like new". Technician B states that a brake l
nikitadnepr [17]

Answer:

Both Technician A and B are correct.

Explanation: A brake lathe is a special tool used to improve or work on the surface of brake pads it helps to smoothen the surface.

Brake lathe has been found to be very effective in removing rusts in rotors and unevenness in the brake pad surfaces in order to ensure the efficiency and effectiveness of the brake system of a vehicle. Hence, a brake lathe helps to make brake rotor surface as smooth as possible.

7 0
3 years ago
Other questions:
  • What is the air change rate (ACH) for a 100 ft^2 (9.3 m^2) space with a 10 ft (3.0 m) ceiling and an airflow rate of 200 cfm (95
    12·1 answer
  • A tank contains 350 liters of fluid in which 50 grams of salt is dissolved. Pure water is then pumped into the tank at a rate of
    8·1 answer
  • What is Differential Analysis in fluid mechanics?
    13·1 answer
  • Explain the differences among sand, silt, and clay, both in their physical characteristics and their behavior in relation to bui
    15·1 answer
  • List two possible reasons the engine oil could have a strong gasoline smell
    15·1 answer
  • Thermodynamics deals with the macroscopic properties of materials. Scientists can make quantitative predictions about these macr
    13·1 answer
  • In water and wastewater treatment processes a filtration device may be used to remove water from the sludge formed by a precipit
    10·1 answer
  • Is an ideal way for a high school student to see what an engineer does on a typical day but does not provide a hands-on experien
    9·2 answers
  • I want to explain what 2000 feet looks like to young children so that they can imagine it in class
    12·1 answer
  • Who does each person work for? Monica works for a power company, Travis works for a utilities company, and Maggie is self-employ
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!