[Skip Navigation] [CSUSB] / [CNS] / [Comp Sci & Eng Dept] / [R J Botting] / [CSci202] / project2
[Text Version] [Syllabus] [Schedule] [Glossary] [Resources] [Grading] [Contact] [Question] [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]
Wed Apr 22 14:09:52 PDT 2009

Contents


    Project 2 Classes

      You must write and test classes to get full credit in Project 2

      You should tackle one of the programming exercises at the end of chapter 10 or chapter 11. List of options below. Detailed list below with comments.

      Due at start of class 8

      UML Please

      Please include a rough diagramn of the classes in your code. Scribble them in a blank spaces in the code. Or on the reverse side of the printout.

      Use the Unified Modelling language.

      A very rough UML scetch is an easy and fast way to start thinking about any new class you are about to code. Engineers have a tradition of using napkins for this kind of design.

      Remember that when you are stuck writing or debugging code, it helps to shift to pictures and diagrams. Rough UML can help.

      Main Program should test classes

      When asked to develop one or more classes you should also develop and hand in a main program that tests the classes. A test of a class is called a "Unit Test". The main program is a good place for a rough picture of all classes tested and all tested connections between them.

      I find that wrting the tests first helps me understnad the classes I have to write better. I use

       	#include <cassert>
      so that the main program can test that an operation/method/function works
       		assert( object.operation(data) == expected_result);

      I'll try to demo this in a lecture/discussion.

      Common Syntax errors in C++ classes

      Common Semantic errors in C++ classes

      Good style in C++ Classes

      Working faster

      Make some blank .h and .cpp files for a Blank class and Operations.

      10.8 Savings Account class

      10.9 IntegerSet class

      I would start with the driver program and add one feature at a time.

      11.15 RationalNumber class

      11.17 Polynomial class

    . . . . . . . . . ( end of section Project 2 Classes) <<Contents | End>>

    Abbreviations

  1. Algorithm::=A precise description of a series of steps to attain a goal, [ Algorithm ] (Wikipedia).
  2. class::="A description of a set of similar objects that have similar data plus the functions needed to manipulate the data".
  3. Data_Structure::=A small data base.
  4. Function::programming=A selfcontained and named piece of program that knows how to do something.
  5. Gnu::="Gnu's Not Unix", a long running open source project that supplies a very popular and free C++ compiler.
  6. KDE::="Kommon Desktop Environment".
  7. object::="A little bit of knowledge -- some data and some know how", and instance of a class".
  8. OOP::="Object-Oriented Programming", Current paradigm for programming.
  9. Semantics::=Rules determining the meaning of correct statements in a language.
  10. SP::="Structured Programming", a previous paradigm for programming.
  11. STL::="The standard C++ library of classes and functions" -- also called the "Standard Template Library" because many of the classes and functions will work with any kind of data.
  12. Syntax::=The rules determining the correctness and structure of statements in a language, grammar.
  13. Q::software="A program I wrote to make software easier to develop",
  14. TBA::="To Be Announced", something I should do.
  15. TBD::="To Be Done", something you have to do.
  16. UML::="Unified Modeling Language".
  17. void::C++Keyword="Indicates a function that has no return".

End