. 20 Course Review
. Previous
.See ./19.html
.Open Prepare
. Template for a CS201 Final
.See ./mock2009.html
. Chapter 1 -- Introduction
.See ./02.html
.See ./lab01
. Chapter 2 -- Introduction to C++
.See ./03.html
.See ./lab02
.See ./04.html
. Chapter 3 -- Introduction to Classes and Objects
.See ./05.html
.See ./lab03
.See ./06.html
.See ./07.html
.See ./lab04
.See ./lab10
. Chapter 4 -- Control Statements -- Part 1
.See ./08.html
.See ./09.html
.See ./lab05
.See ./10.html
. Chapter 5 -- Control Statements -- Part 2
.See ./11.html
.See ./lab06
.See ./12.html
.See ./13.html
.See ./lab07
. Chapter 6 -- Functions
.See ./14.html
.See ./15.html
.See ./lab08
.See ./16.html
. Chapter 7 -- Arrays and Vectors
.See ./vectors.html
.See ./17.html
.See ./lab09
.See ./18.html
.Close Prepare
. Deliver a question and P10
.Open Questions and Answers
. Can you have a vector of strings
Yes.
. Can you return a vector from a function
Yes, but it means copying it and will be inefficient.
. Do you have intialize strings
You have to initialize old-fashioned character arrays: char[...].
You don't have to initialize C++ STL strings. If you omit to do it they
are set to a string with nothing in it.
. What is a scalar
A scalar comes from mathematics -- the opposite of a vector.
In programming a scalar is a single value with no extractable pieces.
Thus int, double, char, are all scalars. Arrays, vectors, and objects
are not scalars.
. When to use recursion vs iteration
Take CS202:-)
Think about the data the function is handling. If it is recursive
then a recursive function will be easiest to write. If the data
is itterative.... use loops.
Think about the problem. Is it describe recursively -- then use recursion.
Else use loops.
. Do variables declared in main have a scope after the end of the main function
No.
. What is an access function
An access function or
.Key accessor
is a function in a class that computes and returns a value with out changing
the object. They express properties of objects. Examples: get age,
get height, get grade,... They are also called
.Key getters
because their name traditionally starts "get".
. What is a predicate
A predicate is a function that returns one of the two bool
values: true or false. Thats all. The term goes bac to formal logic
2000 years ago!
. Is FOIRTRAN still being used in older equipment like weather satelites
(1) It can take a lot of time and money to translate a lot of code from one
language to another.
(2) FORTRAN does a good job of scientific computation.
We have a joke that the programming language used on the Starship
Enterprise is called FORTRAN -- but doesn't look anything like
20th Century FORTRAN.
. Who uses UML Diagrams
Competent proffessionals.
. Can an array have more than two dimensions
Strickly speaking an array in C++ is always one dimensional.
But you can combine or nest as many as you need to get higher
dimensions. For example to play three-dimensional tic-tac-toe
or model a Rubric's Cube you might declare
.As_is Cubey cube[3][3][3];
.Close
. Exercises
. Next -- the Final
. Advert -- CSCI202
I will be teaching CS202 and will be continuing with the same book. We will
start by reviewing functions and arrays.... For more details track the
CS202 blog at
.See ../cs202/index.html
where I will report on the development of the course.