01 Syllabus PDF
01 Syllabus PDF
Programming
Abstractions in
C++
Dr. Cynthia Bailey Lee
2
Today’s Topics
1. Course structure and procedures:
Your Grade
My role
Your role
2. What is this class? What do we mean by
“abstractions”?
Next lecture:
Introduce the C++ language from the Java
programmer’s perspective
(But it’s ok if you are not a Java programmer)
3
What do I do in class?
Think of me as your tutor
Many of you, the programming
aficionados of the incoming class, are
partially or entirely self-taught
This course is designed to continue the most
beneficial aspects of that learning style, but
in a structured/assisted way, ensuring we fill
in any gaps before you continue on
6
What do I do in class?
That means that what I do is:
Be your guide in inducing you to explore
concepts
Create situations and pose puzzles that set
the scene for your exploration
Answer your questions
Not spend lecture reading the textbook to
you with slightly different words
7
To
learn, you must do the work with your own
muscle (your brain).
12
int main(){
cout << "|-5| = " << absoluteValue(-5) << endl;
return 0;
}
int absoluteValue(int n) {
if (n<0){
return -n;
}
return n;
}
24
int absoluteValue(int n) {
if (n<0){
return -n;
}
return n;
}
int main(){
cout << "|-5| = " << absoluteValue(-5) << endl;
return 0;
}
25
int main(){
cout << "|-5| = " << absoluteValue(-5) << endl;
return 0;
}
int absoluteValue(int n) {
if (n<0){
return -n;
}
return n;
}
26
int main(){
int n = getInteger("Enter a number of times to repeat: ");
go(n);
return 0;
}
void go(int n) {
if (n == 0) {
return;
}
cout << "Go!" << endl;
stanford(n-1);
}
void stanford(int n) {
cout << "Stanford!" << endl;
go(n);
}