Ask Question
27 February, 23:36

Write an if/else statement that assigns true to the variable fever if the variable temperature is greater than 98.6; otherwise it assigns false to fever.

+1
Answers (1)
  1. 27 February, 23:49
    0
    If (temperature>98.6) / / checking the condition

    {

    fever=true / / assigned the true value in the fever variable

    }

    else

    {

    fever=false / / assigned the false value in the fever variable

    }

    Explanation:

    Following is the description of statement

    In the given problem we used if/else statement block. The if block is when there condition is true otherwise it executed the else block. In the above answer, we check the condition of "temperature" variable in the if block. If the condition of " temperature" variable is greater than 98.6 then it assigns the true value in the "fever" variable otherwise control goes to else block and executed the statement inside the else block i. e assigned the false value in the "fever" variable.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write an if/else statement that assigns true to the variable fever if the variable temperature is greater than 98.6; otherwise it assigns ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers