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
Consider tests of an unswept wing that spans the wind tunnel and whose airfoil section is NACA 23012. Since the wing model spans
Dominik [7]

Answer:

Check the explanation

Explanation:

to know the lift per unit span (N/m) that is expected to be measured when the wing attack angle is 4°

as well as the corresponding section lift coefficient and die moment coefficient .

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

3 0
3 years ago
.a. What size vessel holds 2 kg water at 80°C such that 70% is vapor? What are the pressure and internal energy? b. A 1.6 m3 ves
vesna_86 [32]

Answer:

Part a: The volume of vessel is 4.7680m^3 and total internal energy is 3680 kJ.

Part b: The quality of the mixture is 90.3%  or 0.903, temperature is 120 °C and total internal energy is 4660 kJ.

Explanation:

Part a:

As per given data

m=2 kg

T=80 °C =80+273=353 K

Dryness=70% vapour =0.7

<em>From the steam tables at 80 °C</em>

Specific volume of saturated vapours=v_g=3.40527 m^3/kg

Specific volume of saturated liquid=v_f=0.00102 m^3/kg

Now the relation  of total specific volume for a specific dryness value is given as

                                  v=v_f+x(v_g-v_f)

Substituting the values give

v=v_f+x(v_g-v_f)\\v=0.00102+0.7(3.40527-0.00102)\\v_f=2.38399 m^3/kg

Now the volume of vessel is given as

v=\frac{V}{m}\\V=v \times m\\V=2.38399 \times 2\\V=4.7680 m^3

So the volume of vessel is 4.7680m^3.

Similarly for T=80 and dryness ratio of 0.7 from the table of steam

Pressure=P=47.4 kPa

Specific internal energy is given as u=1840 kJ/kg

So the total internal energy is given as

u=\frac{U}{m}\\U=u \times m\\U=1840 \times 2\\U=3680 kJ

The total internal energy is 3680 kJ.

So the volume of vessel is 4.7680m^3 and total internal energy is 3680 kJ.

Part b

Volume of vessel is given as 1.6

mass is given as 2 kg

Pressure is given as 0.2 MPa or 200 kPa

Now the specific volume is given as

v=\frac{V}{m}\\v=\frac{1.6}{2}\\v=0.8 m^3/kg

So from steam tables for Pressure=200 kPa and specific volume as 0.8 gives

Temperature=T=120 °C

Quality=x=0.903 ≈ 90.3%

Specific internal energy =u=2330 kJ/kg

The total internal energy is given as

u=\frac{U}{m}\\U=u \times m\\U=2330 \times 2\\U=4660 kJ

So the quality of the mixture is 90.3%  or 0.903, temperature is 120 °C and total internal energy is 4660 kJ.

5 0
3 years ago
Explain the term electric current as used in engineering principles​
vodomira [7]

Answer:

<em>Electric current is the movement of electrons through a wire. Electric current is measured in amperes (amps) and refers to the number of charges that move through the wire per second. If we want current to flow directly from one point to another, we should use a wire that has as little resistance as possible.</em><em>Current is directly proportional to voltage, inversely proportional to resistance. One of the most common electrical measurements you'll use is the watt, a unit of electrical power: W (Watts) = E (Volts) x I (Amperes). The quantity of electric charge is measured in coulombs.</em><em>They can even pass through bones and teeth. This makes gamma rays very dangerous. They can destroy living cells, produce gene mutations, and cause cancer.</em>

Explanation:

hey mate this is the best answer if you're studying engineering!

8 0
3 years ago
Read 2 more answers
What is the resistance of a circuit with three 1.5 v batteries and running at a current of 5A?
adoni [48]

Answer:

0.3 Ω

Explanation:

Resistance (R) = V/I

R = 1.5/5

R = 15/50

= 3/10

= 0.3Ω

hope it helps :)

3 0
3 years ago
Define the Artist class in Artist.py with a constructor to initialize an artist's information. The constructor should by default
Sunny_sXe [5.5K]

Answer:

Explanation:

As a result of the codes used to making this solved, i was unable to upload my answer, therefore i'm sending a screenshot of the codes.

thank you for your understanding,

cheers i hope this helps

5 0
3 years ago
Other questions:
  • A satellite orbits the Earth every 2 hours at an average distance from the Earth's centre of 8000km. (i) What is the average ang
    7·1 answer
  • Using any of the bilinear transform, matched pole-zero, or impulse invariance techniques in converting a continuous-time system
    14·2 answers
  • 3. (20 points) Suppose we wish to search a linked list of length n, where each element contains a key k along with a hash value
    7·1 answer
  • The value 100 MW is equivalent to (a) 100×10^6 w (b) 100 x 10^-6 w (c) 100 x 10^-3 w (d) 100 x 10^3 w
    14·1 answer
  • Which is the correct definition of schematic? a type of computer program that project managers use to track engineers on a proje
    13·1 answer
  • can someone please define these three vocabulary words for my stem class i will give brainliest if i can figure out how
    15·1 answer
  • List six clues that indicates that you are approaching an intersection
    10·1 answer
  • How to install a curt 5th wheel hitch in a 2017 chevy silverado
    14·1 answer
  • Hello, I have a question, I would be glad if you can help.
    5·1 answer
  • Javier’s class visited a power plant near his city, and they learned how it produced electricity. What does this form of power d
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!