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

Which pair of terms best describes a wooden table? biotic and nonliving biotic and living abiotic and nonliving abiotic and living
In the North Area Mall, 18 of the 90 stores sell shoes. If that same ratio holds true for the University Mall and 9 stores there sell shoes, how many stores are
Determine the empirical formula of Magnesium Oxide from following data. Type the calculations. Mass of Crucible and Cover + magnesium ribbon (before heating) =
help help help help pls​
-What are the main causes of WWI?
Can someone explain or help me out
How are t I he images in the first and second stanzas differe
Please help me with my essay How can sports stadiums bring urban change? I’ll mark brainliest
Can someone explain or help me out
You're doing research for a public essay on alternative medicine. Which of the following sources has the most reliable information?