. . . . . . . . . ( end of section Prepare) <<Contents | End>>
Deliver a question and P10
Questions and Answers
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.
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
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
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
Cubey cube[3][3][3];