Answers to Chapter 8 Review Questions
||Which general type of statement would you use to implement each of the following logical descriptions:|
If number is greater than 100, write “greater than 100” onscreen; otherwise, write “less than or equal to 100.”
Repeatedly check each letter of a string until no more letters are left in the string.
The branching statement if-else.
||Suppose that your program contains three variables called rainfall, wind, and temperature, all of type double. For each of the following points, write a few lines of code that implement the described logic (you don't need to write the whole program):|
If rainfall is greater than 100, write “Heavy rainfall” onscreen.
If rainfall is greater ...
Get C# Primer Plus now with O’Reilly online learning.
O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.