Week 2

This week, we learned the basic rules of C++ including literals, identifiers, symbols, variables, arithmetic operators, assignment, standard input/output (cin/cout). These topics are mainly from Chapter 2 of the textbook (Tapestry).  However, input stream (cin), variables, data types and arithmetic operators are in Sections 3.1 and 3.2. Assignment operator is discussed in Section 4.1.

Then we continued with other basic data types such as char, double and other versions of int. We covered limits of these data types and discuss integer overflow. We also covered some more arithmetic operations and operator precedence and finished with some more assignment operators. We only could not cover the fahrcels.cpp file in class, we will cover it in the recitations next week. These are in basics.ppt file below. Topics are mostly from Chapter 3 of the textbook (up to section 3.4), but it includes assignment operator which is in Chapter 4 of the book. Integer and real representation and limits are not detailed in the book. short, signed, unsigned are not explained in the book either.

Example programs we covered in the class (area.cpp, time.cpp and time2.cpp) are not in the book. These programs are given below.

The .swf file (animation) should be copied to the same folder as the basics.ppt file.

Powerpoint files and animations

basics

basics2

cin.swf

C++ codes discussed in class (some of them might have been modified in class to show extra features)

area_cpp

daysecs_cpp

time_cpp

time2_cpp

fahrcels_cpp