CISC181 8am 02/14/05 (1) Continue going over the Farenheit to Celsius program at: http://udel.edu/~pconrad/cisc181/05S/work/labs/lab01/lab01b.cc Three ways to handle the std:: stuff (1) using namespace std; (2) put it before each reference to "cin", "cout", etc.. e.g. std::cout << "Hello World" << std::endl; (3) Each individual item, a separate using statement, e.g. using std::cout; using std::endl; using std::cin; For reasons that are more apparent when you are working on a large real-world project, in the real world (professional large scale c++ development, method 3 is preferred) On labs, projects, and anything you do for this class where time is not an issue, I would prefer you to use method 2 or 3. When time is an issue, e.g. in lecture, quizzes, or exams, method 1 is perfectly acceptable. Types: int for integers float or double for real numbers double is almost always preferred over float you need to know that float exists, but you should almost always use double instead. The number of bits used to represent int, float, double can vary from system to system. On strauss how big is an int, float or double? How can we tell? Use the built-in feature of C++ "sizeof". (side note on emacs: to visit another file, use CTRL/X, CTRL/F). (another emacs side note: CTRL/A beginning of line CTRL/E end of line CTRL/K kill line CTRL/Y yank (paste) CTRL/spacebar OR CTRL/shift-2 "set mark" esc-W (written M-w "meta-w") copy of "region" (between "point" and "mark"... "point" is where the cursor is. ) If you are in a terminal session in emacs, and you want to drop to a command line temporarily, use "CTRL/Z" to temporarily drop to a command line (putting emacs in the "background".) Use "fg" at the command line to bring emacs back into the "foreground". Read more about "foreground" and "background" in your Just Enough Unix textbook by Anderson.. these are important Unix concepts. CTRL/X B (not CTRL/X CTRL/B) allows you to switch between two files you are "visiting" in emacs. CTRL/X CTRL/W is how you do a "save as" (W stands for "write file"). Compiling the "sizeofDemo.cc" program > make demoSizeof.cc `demoSizeof.cc' is up to date. > make demoSizeof CC -o demoSizeof demoSizeof.cc > make demoSizeof `demoSizeof' is up to date. > ./demoSizeof sizeof(a) is 4 sizeof(b) is 8 sizeof(c) is 4 sizeof(int) is 4 sizeof(float) is 4 sizeof(double) is 8 (3) Modifying the farenToCelsius program to do milesToKm conversion. (4) Modifying that program to use a loop to print a table of values.