[Skip Navigation] [CSUSB] / [CNS] / [Comp Sci & Eng Dept] / [R J Botting] / [CSci201] / 20
[Text Version] [Syllabus] [Schedule] [Glossary] [Labs] [Projects] [Resources] [Grading] [Contact] [Search ]
Notes: [01] [02] [03] [04] [05] [06] [07] [08] [09] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] <20>
Labs: [01] [02] [03] [04] [05] [06] [07] [08] [09] [10]
Fri Mar 20 18:09:08 PDT 2009

Contents


    20 Course Review

    Previous

    [ 19.html ]

    Prepare

      Template for a CS201 Final

      [ mock2009.html ]

      Chapter 1 -- Introduction

      [ 02.html ] [ lab01 ]

      Chapter 2 -- Introduction to C++

      [ 03.html ] [ lab02 ] [ 04.html ]

      Chapter 3 -- Introduction to Classes and Objects

      [ 05.html ] [ lab03 ] [ 06.html ] [ 07.html ] [ lab04 ] [ lab10 ]

      Chapter 4 -- Control Statements -- Part 1

      [ 08.html ] [ 09.html ] [ lab05 ] [ 10.html ]

      Chapter 5 -- Control Statements -- Part 2

      [ 11.html ] [ lab06 ] [ 12.html ] [ 13.html ] [ lab07 ]

      Chapter 6 -- Functions

      [ 14.html ] [ 15.html ] [ lab08 ] [ 16.html ]

      Chapter 7 -- Arrays and Vectors

      [ vectors.html ] [ 17.html ] [ lab09 ] [ 18.html ]

    . . . . . . . . . ( end of section Prepare) <<Contents | End>>

    Deliver a question and P10

    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.

    1. Elseuse 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 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];

    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 [ ../cs202/index.html ] where I will report on the development of the course.

    Abbreviations

  1. Algorithm::=A precise description of a series of steps to attain a goal, [ Algorithm ] (Wikipedia).
  2. Function::programming=A selfcontained and named piece of program that knows how to do something.
  3. Gnu::="Gnu's Not Unix", a long running open source project that supplies a very popular and free C++ compiler.
  4. KDE::="Kommon Desktop Environment".
  5. OOP::="Object-Oriented Programming", Current paradigm for programming.
  6. Semantics::=Rules determining the meaning of correct statements in a language.
  7. SP::="Structured Programming", a previous paradigm for programming.
  8. Syntax::=The rules determining the correctness and structure of statements in a language, grammar.
  9. Q::software="A program I wrote to make software easier to develop",
  10. TBA::="To Be Announced", something I should do.
  11. TBD::="To Be Done", something you have to do.
  12. UML::="Unified Modeling Language".
  13. void::C++Keyword="Indicates a function that has no return".

End