rileysuxatmath7771 rileysuxatmath7771
  • 11-07-2019
  • Computers and Technology
contestada

Write a conditional expression that assign the value 0 to a credits variable if it is less than 0; otherwise the value of the credits variable remains unchanged.

Respuesta :

tonb
tonb tonb
  • 11-07-2019

Answer:

credits = (credits < 0) ? 0 : credits;

Explanation:

This is the ternary conditional operator.

Answer Link
joaobezerra joaobezerra
  • 17-01-2020

Answer:

void updateCredit(float credit){

if credit < 0.0

credit = 0.0;

}

Explanation:

I am going to write a C function for this.

The input is your credit value, and it has just a conditional to verify if it is not negative.

void updateCredit(float credit){

if credit < 0.0

credit = 0.0;

}

Answer Link

Otras preguntas

The sum of two consecutive integers is at least 36. What is the least possible pair of integers? A. 16 and 17 B. 17 and 18 C. 19 and 20 D. 18 and 19
What is 7 2/10 as a decimal
Ann took a taxi home from the airport. The taxi fare was $2.10 per mile, and she gave the driver a tip of $5. Ann paid a total of $49.10. Write an equation to d
what expression is not equivalent to this expression? 11y-5 88y-40 5y-11 19y-3 22y-10
Choose one of the factors of x*3 + 343. a. x − 7 b. x*2 − 14x + 49 c. x*2 + 7x + 49 None of the above
What is 23/9 as a mixed number
The Cost of 625 bolts is $100.What is the coast of 10 bolts? Please explain it or showed work ,Thank you
An equation is shown below: −2(4x − 1) − 7 = 5 Which statement shows a correct next step in solving the equation? A)The equation can become −2(4x − 1) = −2 by a
Evaluate the expression when x = 8 and y = 1. x/2y A. 8 B.1/8 C.4 D.1/4
Simplify the expression [(12+4)x2+3]x5 a. 47 b. 400 c. 175 d. 300