CS102 Object-Oriented Intermediate Programming - PowerPoint PPT Presentation

About This Presentation
Title:

CS102 Object-Oriented Intermediate Programming

Description:

CS102. Object-Oriented Intermediate Programming. Sami Rollins ... Course web page: http://www.mtholyoke.edu/courses/srollins/cs102/ Academic Dishonesty ... – PowerPoint PPT presentation

Number of Views:19
Avg rating:3.0/5.0
Slides: 9
Provided by: samiro
Category:

less

Transcript and Presenter's Notes

Title: CS102 Object-Oriented Intermediate Programming


1
CS102Object-Oriented Intermediate Programming
  • Sami Rollins
  • srollins_at_mtholyoke.edu
  • Spring 2006

2
Introduction
  • Course web page
  • 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 ltvectorgt
  • vectorltelt-typegt name(size)
  • vectorltintgt myints(5)
  • vectorltstringgt mystrings(10)

8
vector cont.
  • Can access vector elements like array
  • myints2
  • Functions
  • at(index) -- myints.at(2) returns item at
    position 2better 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
Write a Comment
User Comments (0)
About PowerShow.com