Checkpoint 4.72 Write a statement that uses a conditional expression that determines if the credits variable is less than 0. If the condition is true, assign the value 0 to the credits variable, otherwise the value of the credits variable should remain unchanged.

Respuesta :

Answer:

See step to step explanations for answer.

Explanation:

This is the expression to check if credits is less than 0 assuming variable name is credits:

if(credits<0)

{

credits = 0;

}

Q 4.69:

this is the expression checking the name is Swordfish or not

if(name=="Swordfish")

{

cout<<"We have a match";

}

Q 4.67

This is the expression to check the character assuming that character is ch

if(ch>='1' && ch<='9')

{

cout<<"Digit detected";

}

Q 4.59:

This is the statement to check if the number is between 0 and 500 inclusive . Assuming the variable is n

if(n>=0 && n<=500)

{

cout<<"The number is valid";

}

ACCESS MORE