-----BASIC C++ PROGRAM TEMPLATE----- #include using namespace std; int main (int argc, char **argv) { /* Variable Declaration */ /* Instructions */ return 0; } ------ COMMENTS --------------- /* Put explanatory messages for yourself and other programmers (not the computer) in comments like this one */ //single line comments look like this ------EDIT SAVE COMPILE RUN ------------- or EDIT, SAVE, COMPILE, FIX COMPILER ERRORS, RUN, CHECK OUTPUT 1) Edit your code with an editor like emacs or nano (learning to navigate in at least one editor on polaris is going to be important for this class) E.g. emacs -nw myprogram.cpp OR nano myprogram.cpp Remember to save you changes! 2) Compile your code with a compiler (translates human readable source code into executable format the computer needs to actually run the program) E.g. g++ myprogram.cpp Fix any compiler errors! Go to first problem by it's line number and fix. 3) Run your program E.g. ./a.out Check that the output of the program is what you expect -----SIMPLE TYPES----- TYPE EXAMPLES int 0,1, -1, 2, -2,... unsigned int 0, 1, 2,3, 4, ... float 2.89, 67777799.0 double char 'a', 'Z', '\n', '1' bool true, false string "August", "String can hold a whole book or just one letter\n", "a" possible numeric values are not infinite like in math - e.g. there is a fixed amount of space to store an int and so unlike in real like there is a maximum integer unsigned int vs int - use space to store all positives vs half positive and half negative unsigned and int vs float float can store bigger and smaller numbers but to do so can give up precision float vs double - more space used for both bigger numbers and more precise numbers "3", '3', 3.0, 3 are all different values! -----SAMPLE VARIABLE DECLARATIONS------ int month; char answer; bool isReady = false; char initial = 'A'; float wage = 8.50; string name = "John Smith"; unsigned int year = 1996; Remember to use descriptive variable names!!