Chapter 5

CONDITIONS, LOGICAL EXPRESSIONS, AND SELECTION CONTROL STRUCTURES

ANSWERS TO QUESTIONS

True/False

    1. True 4. True 7. False 10. True 13. False
    2. False 5. False 8. False 11. True 14. True
    3. False 6. False 9. False 12. False 15. False

Multiple Choice

    1. b 20. e 24. d 28. a 32. c 36. b
    2. d 21. b 25. d 29. c 33. a 37. d
    3. c 22. b 26. e 30. d 34. e
    4. c 23. b 27. d 31. e 35. c

Fill-In

38. logical (Boolean)

39. relational

40. short-circuit (conditional)

41. logical (Boolean)

42. full

43. testScore >= 90 && testScore <= 100

44. x != 5 && y != 5

45. flow of control

    1. selection (branching)

47. multi

48. testing the state

49. control structure

50. postcondition

51. code walk-through

52. precondition

53. code

54. walk-through (algorithm walk-

through)