[Skip Navigation] [CSUSB] / [CNS] / [CSE] / [R J Botting] / [CSE201] / 18
[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]
Mon Apr 29 14:43:58 PDT 2013

Contents


    cs201/18

      Previous 17 vectors

      [ 17.html ]

      Project 8 Due

      [ projects.html#P8 ] (P6 with UML documentation)

      Study pages 275-280

        Code examples mentioned in chapter 6

        Chapter 6 of the text refers to many examples like this
         	ch08/between.cpp
        I have uploaded them into [ ch06/ ]

        6.3 Vector Parameters and Return Values

        Advanced Topic 6.2 Passing vectors by constant Reference

        Good idea! Simple. Fail safe. Efficient. DO IT!

        6.4 Removing and Inserting Vector Elements

        You have to reorganize the data.

        Quality Tip 6.2 Make Parallel vectors into Vectors of Objects

        Good idea!

        For example -- a program that simulates a card game will need to model a deck of cards. Don't declare

      1. vector <int> suits(52);
      2. vector <int> ranks(52);

        Instead declare

         		class Card
         		{
         			...
         			int suit;
         			int rank;
         		};
        plus
         		vector <Card> deck(52);

        As a rule the closer the language in your program reflects the real world the easier the program will be to grow. An in the real world programs grow and grow for ever.

        My notes on vectors

        [ vectors.html ]

        Review Questions

        R6.9 to R6.16 inclusive

      Spot the bug exercise

      [ mock.cpp ]

      Exercises on vectors in functions

      [ vector.ex.cpp ]

      Exercises on vector of objects

      [ vectorOfObjects.ex.cpp ]

      Quiz 8 on vectors

      TBA

      Lab 9 Classes and the UML

      [ lab09 ]

      Lab 10 Vectors -- Next week

      [ lab10 ]

      Next 19 Arrays

      [ 19.html ]

      Next project

      The next and last project [ projects.html#P9 ] will have a question about it in the final. You need to do it, even if you have a lot of points already.

    Abbreviations

  1. Algorithm::=A precise description of a series of steps to attain a goal, [ Algorithm ] (Wikipedia).
  2. Class::=A description of a type of object that includes the data it knows and the functions it can execute.
  3. Function::programming=A selfcontained and named piece of program that knows how to do something.
  4. Gnu::="Gnu's Not Unix", a long running open source project that supplies a very popular and free C++ compiler.
  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", industry standard design and documentation diagrams.
  13. void::C++Keyword="Indicates a function that has no return value".

( End of document ) <<Contents | Top