. Display a statement that explains the conversion c. If the Celsius temperature is less than 0 tell the user it is freezing, if it is greater than 100 tell them it is boiling. Have the user enter in a temperature in Celsius d. Convert the temperature to Fahrenheit F=(9/5)*C+32 e. Display a statement that explains the conversion f. If the Fahrenheit temperature is less than 32 tell the user it is freezing, if it is greater than 212 tell them it is boiling.
Complete the following expressions and equations. If a number does not have a decimal in it consider it to be an integer and do integer division. If it has a decimal in it consider it a float and do float division.
Value Produced
Value Produced
7
1 9 24 24 False true False True False
True
True True 0.5 2 2 2 2 2 2.0
Decision Making and the Selection Structure Directions: Read all instructions carefully.
___
3. The condition (3>4 && 12>9 is true 4. The condition (3<4 && 7>4) is true
T T
F F
4) The following expressions make sense but are invalid according to C rules of syntax. Rewrite them so that they are valid logical expressions. (all variables are integer) x< y <= z
Matching 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. ____________ ____________ ____________ ____________ ____________ ____________ ____________ ____________ ____________ ____________ && || ! < <= >= == > != = A. B. C. D. E. F. G. H. I. J. OR Not Equal to Not Less than or equal to Less than greater than or equal to Greater Than Equal To Assign And
15) Trace the output for the following code fragment (6) Program Output
int x = 5;
Part 1
printf(Part 1\n); if (x > 3) printf(A\n); if (x <= 10) printf(B\n);
A B Part 2 D
int x = 4;
Program Output
Two
if (x > 10) printf(One\n); else printf(Two\n);
Three
Start
If(x>5)
Second
Print first
Print 9
End
If(x>y*7)
Less then
Greater then
End