The purpose of this homework is to give you a chance to focus your knowledge of ABOC Chapter 3 (and similar parts of Chapter 1).
Do problems 3.1, 2, 4, 5, 6 (after the unsigned change, also test with either two 4000000000s or two 64000s and explain the results), 7, 9 (why did the format fail to line up without the + signs? maybe 11.1 could shed some light...), 10-13, 16-18, 20, 22, 23 (also try 'short double' which would often be synonymous with 'float'), 25-27.
In addition, do the following problems:
(I know it seems like a lot of problems, but they are rather small.)
To hand this in, make sure you script your tests. But avoid scripting a vi session. (You may want to try this to see why I say not to, but make it a short session.) You can avoid this by simply having multiple terminal windows open: script in one and vi in another.
This assignment is (Level 3).
Add (Level 1) to do problem 1.17. You'll also need to write a 1-2 page description of your approach to discovering this input.
Add (Level 1) to do problems 3.14 & 15. Most C++ compilers compile C code, but not necessarily vice versa. Luckily the GNU Compiler Collection (GCC) does supply both compilers. This is what we use here on the HP/UX box and it is also what you'll find in Linux and Cygwin. Even Quincy can use MinGW which is a stripped down version of the GCC.
Add (Level 1) to do problem 3.19. Hint: What does a fractional power represent? If 0.5 is a square root and 0.3333 is a cube root, what would 0.72 or 0.14 be?
Add (Level 1) to do problem 3.24. Tip: to embed special characters in a text file, use Ctrl-V in vi. For instance, to embed a form-feed (to force a page to eject from a printer), you would type Ctrl-V Ctrl-L in edit mode. (Note: Appendix D lists this as 'np' -- presumably for 'new page' -- but many references indicate 'FF' for 'form feed'. Check out 'man ascii' on Linux or our HP/UX box for more info. The HP/UX 'man ascii' even has tips on using such codes in vi -- around the 3rd or 4th screen.)