This
preview
has intentionally blurred sections.
Sign up to view the full version.
Unformatted text preview: original, but the changed program uses a while loop instead of a for loop for the inner loop. Copy the program you wrote for problem 3 and update it so that for any input number, it behaves the same way, but uses a do-while loop instead of a for loop for the outer loop. Be careful! (Hint: How does it behave if len is not positive? You may need to add a little additional code to make sure the program behaves identically to the program in problem 3.) Assume month has been previously declared as an int and given a meaningful value. Write a switch statement that for any value of month , produces exactly the same output as the following if statement. if (month == 6) cout << "summer solstice"; else if (month == 12) cout << "winter solstice"; else if (month == 3 || month == 9) cout << "equinox"; else cout << "nothing special";...
View
Full Document
- Spring '00
- Melkanoff
- len, cout cout cout
-
Click to edit the document details