Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS102 Object-Oriented Intermediate Programming Sami Rollins Spring 2006.

Similar presentations


Presentation on theme: "CS102 Object-Oriented Intermediate Programming Sami Rollins Spring 2006."— Presentation transcript:

1 CS102 Object-Oriented Intermediate Programming Sami Rollins srollins@mtholyoke.edu Spring 2006

2 Introduction Course web page: –http://www.mtholyoke.edu/courses/srollins/cs102/http://www.mtholyoke.edu/courses/srollins/cs102/ Academic Dishonesty

3 A bit about programming… What do you like about programming? What do you want to learn about programming? What do you find most challenging with respect to programming?

4 C++ Programming Review What is an algorithm? What is a variable? How do you declare a variable? What is a function? –What is/when do you use call by value? void func(string s); –What is/when do you use call by reference? void func(string & s); –What about call by constant reference? void func(const string & s);

5 C++ Programming Review What is an if statement? When would you use one? What is a loop? What are the different types of loops? When would you use each type? What is an array? What is a pointer? –& and *

6 string Declaration Concatenation Operator overloading Functions –length –find –insert –c_str

7 vector An array-like container class #include vector name(size) vector myints(5); vector mystrings(10);

8 vector cont. Can access vector elements like array –myints[2] Functions –at(index) -- myints.at(2) returns item at position 2…better than [] because of bounds checking – size() -- returns total size of vector –front() -- returns first element (at position 0) –back() -- returns last element at position size-1


Download ppt "CS102 Object-Oriented Intermediate Programming Sami Rollins Spring 2006."

Similar presentations


Ads by Google