See the bottom for how to submit your work.
Due: Before 0800 on next class day
| expression | evaluated as | due to |
| x + y * z | (x + y) * z OR x + (y * z) | precedence OR associativity |
| x > y + z | (x > y) + z OR x > (y + z) | precedence OR associativity |
| cin >> x >> y | (cin >> x) >> y OR cin >> (x >> y) | precedence OR associativity |
| x = y = 1 | (x = y) = 1 OR x = (y = 1) | precedence OR associativity |
| x = y == z | (x = y) == z OR x = (y==z) | precedence OR associativity |
Note: each expression should be taken
as independent. I.e. if one expression modifies some variable values, those
modifications do not carry over to the next expression.
|
|
|
|
| Year | divisible by 4? | divisible by 100? | divisible by 400? | Is leap year? |
| 703 | no | no | no | not leap year |
| 704 | yes | no | no | leap year |
| 700 | yes | yes | no | not leap year |
| 800 | yes | yes | yes | leap year |
$ ./hw
Enter year: 703
Is Not Leap Year
$ ./hw
Enter year: 2020
Is Leap Year
Turn in (Due: 0800 on the next class day)
~/bin/submit -c=IC210 -p=hw05 hw.cpp