[Skip Navigation] [CSUSB] / [CNS] / [Comp Sci & Eng Dept] / [R J Botting] / [CSci202] / index
[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]
Sat Jun 20 15:37:33 PDT 2009
Opening the PDF files on this page may require you to download Adobe Reader or an equivalent viewer (GhostScript).

Contents


    CS202 Web Site and Blog

      2009-06-20 Sat Jun 20 15:20 First Course and Final grades posted

      Please check [ grading/ ] they may yet change if I discover or I am told an error.

      2009-06-15 Mon Jun 15 17:29 Grades Posted

      I've posted all scores including extra credit etc. I've figured a rough estimate of the course grade assuming you perform in the final as you have in class.

      The number of points before the final is limited to 300. There are 200 in the final. The final typically determines your course grade.

      Best of luck.... and have a good summer.

      2009-06-15 Mon Jun 15 13:22 Questions answered

      Last class [ 20.html ] this afternoon, followed by [ lab10.html ] the last lab.

      I hope we can post the pre-final grading tonite or tomorrow afternoon.

      The final exam is 2-3:50pm on Wednsday 17th of June, as scheduled.

      Course grades will be posted when we get them done.

      2009-06-12 Fri Jun 12 10:02 Grades posted

      I've posted the latest grades.... but they don't have a complete set of Lab10 yet -- if you are a Monday lab person my estimate of your course grade may be a little low. We will update these by Tuesday morning.

      The blank sheets show you how I will be scoring the final, and calculating the grade for the course.

      See you Monday for the last [ 20.html ] class.

      2009-06-10 Wed Jun 10 12:19 Questions on STL Algorithms Answered

      Thanks for the interesting [ 19.html ] questions.

      Next time -- you can ask a question on anything in the book from Chapter 1 thru to Chapter 22 + the Appendix on command line arguments.

      2009-06-08 Mon Jun 8 18:16 Grades posted

      [ /grading/ ]

      2009-06-08 Mon Jun 8 16:53 Date and Time of Final

      I have checked with the official final exam time table for the campus. Our final is on Wedns Jun 17th from2 to 3:50pm.

      If this conflicts with another class -- please check with your Spring schedule and with the teacher.... some Monday/Wednsday classes do have Friday finals!

      2009-06-05 Fri Jun 5 13:05 Some grades posted

      I'll be posting lab09 grades Tuesday next week. But here [ grading/ ] are the latest figures.

      Next class is [ 18.html ] and introduces the Standard Template Library. Don't panic.

      2009-06-03 Wed Jun 3 10:18 Questions and Answers posted

      [ 17.html ]

      2009-06-02 Tue Jun 2 13:28 Help with Questions and Contact

      Could somebody please try the "Question" and "Contact" buttons in this directory to see if my quick fix is working.

      2009-06-02 Tue Jun 2 09:51 Grades posted

      We now have a complete set of lab08 scores and so I can post [ grading/ ] without making half the class feel they are 10 points behind.

      The next class in on chapter 21 and a piece of an Appendix: [ 17.html ] (recently changed) and [ project4.html ] is due -- show us you can open, process and close a file correctly. There is also a quiz.

      2009-06-01 Mon Jun 1 17:08 New Tree Sort on page

      [ treesort.cpp ] (YES! -- compiled, ran, and passed test on first attempt)

      2009-06-01 Mon Jun 1 10:31 Deadline passed for Quesion on Linked Lists

      I'm improving the answers [ 16.html ] right now.

      2009-06-01 Mon Jun 1 07:44 Help with bigO

      [ 000957.html ]

      2009-05-30 Sat May 30 07:16 Contact and Question buttons dead

      Please shift to sending regular EMail to CSUSB... and include CS202 in the subject.

      My apologies -- I moved the web site to a new server Friday afternoon.

      2009-05-29 Fri May 29 10:29 Partial Grades posted

      A complete set with totals, %s, and letter grades will be put up on Tuesday when both halves of the class have done the lab.

      [ grading/ ]

      2009-05-28 Thu May 28 10:20 Joke of the day -- DropSort -- a look ahead

      Here is a fun example: [ dropsort.html ] (Ho Ho Only Serious). It is an example of how you can meet any performance goal by making the program less than correct.

      The next class in on Monday [ 16.html ] and will introduce Data Structures -- and review Chapter 20.

      The lab on Monday night [ lab08.html ] is the same as that yesterday night.... and we all went home early:-)

      Check the schedule!!

      The last class and lab is on the last Monday of the quarter -- June 15th.

      The finals start on the Tuesday of that week. Our CS202 final is on the Wednsday (June 17th) from 2pm to 3:50pm. It is the deadline for all extra credit work -- projects and seminar reports.

      By the way -- I base the final on the quizzes, labs, handouts, and work done in class. Review the graded quizzes before the final!

      2009-05-27 Wed May 27 13:25 Deadline passed..... Class 15 Chapter 19

      [ 15.html ]

      2009-05-27 Wed May 27 10:07 Deadline for questions on chapter 19 extended

      Since we had a disk drive crash last night I'll accept late questions on Algorithms and Chapter 19 until 1pm today. The answers may suffer:-(

      Todays class is about the Laws of Computer Science -- these are mostly deep and difficult to graps with out mathematics. However one of them is pretty much common knowledge: Murphy 's Law which states that "If Anything can go wrong, it will!" This law was first promulagated in the Airforce base near Adelanto in the Second World War as a philosophy of testing.

      We had a perfect example this morning -- I sent out an email inviting Email questions almost 5 minutes before the server came online again.

      2009-05-22 Fri May 22 13:27 Grades Posted

      The next class [ 15.html ] is on Wednsday.... Study the handout and the chapter..... and bring a Deck of Cards to class.

      2009-05-20 Wed May 20 13:33 Ready for Strings

      [ 14.html ]

      Holiday next Monday.

      Next time: bring a deck of cards and study the special handout on Algorithms before reading the next chapter on Searching and Sorting [ 15.html ]

      2009-05-18 Mon May 18 10:58 Questions of Files ready...

      [ 13.html ]

      Coming events: [ schedule.html ] Strings, Holiday, Algorithms, ... Project 4.

      2009-05-15 Fri May 15 14:00 Grades...

      Grades are posted [ grading/ ] and the next topic is handling data in files [ 13.html ] which adds to what you already know about streams.

      2009-05-13 Wed May 13 10:45 Deadline passed and questions answered

      I'm publishing [ 12.html ] with answered questions. I may add some late questions ... but they wont get any points:-(

      Today the third Project is due at the start of class, and the class finishes with the third quiz. Best of luck.

      2009-05-12 Tue May 12 11:21 Seminars

      We've now got 4 seminars scheduled ... and more expected:
      Table
      DayDateEvents
      FMay 15Seminar 10:30am Visiting Speaker [ seminar/20090515JimJones.txt ]
      ThMay 21Seminar 2pm Sean Lo MS Project Presentation [ seminar/20090521SeanLo.txt ]
      ThMay 21Seminar 3:30pm Nabeel MS Project Presentation [ seminar/20090521NabeelAlzahrani.txt ]
      FMay 22Seminar 10:30am Visiting Speaker [ seminar/20090522YateChingYuan.txt ]

      (Close Table)
      You can make up 5 points each time you attend one of these and give me a readable (but short) report of who was speaking, what they talked about, and what was interesting to you about it.

      2009-05-08 Fri May 8 10:50 Grading done

      [ grading/ ]

      Next class is [ 11.html ] on handling streams of data.

      Please use the [Question] link at the top of the page to send me a question before 10am on Monday.

      2009-05-06 Wed May 6 16:22 Questions answered on templates

      I've answered all the questions on templates -- including those handed in in class -- and posted them [ 10.html ] to the web site. This includes the answer to the exercise [ 10templates.cpp ] we did together on a generic "swap" function.

      2009-05-06 Wed May 6 11:23 Questions and Contact Working

      Ken fixed them about 30 minutes ago--- and I've just finished testing the "Buttons".

      2009-05-05 Tue May 5 12:11 Problems with web site

      After the web server crashed on Monday I've been able to re-upload all the CS202 files again.

      The "Search" feature is working. But at this time the "Contact" and "Question" buttons are not working.

      (1) Come back here to see the latest information.

      (2) Back up plan for sending questions. Send Email to my CSUSB.edu account with name rbotting. Put

       		CS202/Qn
      at the start of the Subject line in the message.

      More....

      2009-05-04 Mon May 4 10:16 Grades corrected

      An alert student noted that we had scored projects out of 10 rather than 20. I've doubled the scores. I've also corrected the other error that some one pointed out.

      Thank you for checking.

      2009-05-01 Fri May 1 11:35 Contact now works and grades posted

      I've updated the mailme script I use to handle the "[Contact]" button at the head of the page. Please use it for work and casual questions. The [Question] button is for the questions of the text.

      2009-05-01 Fri May 1 11:24 Grades posted and Broken Contact Button discovered

      Grades are published at [ grading/ ] on this web site.

      I've just discovered that the [Contact] button has been silently failing. The [Question] button had been updated to the new web server at the start of the quarter. I failed to do the samething with the "mailme" script used in the [Contact] button. I will be working to fix this today. Meanwhile.... if you have used the "[Contact]" button to send me questions or work it has been lost. If you evidence I will backfill the credit. My grovelling apologies.

      By the way -- If had engineered the web site properly then this problem would not have arrisen. Each time you ignore the advice our book gives you accumulate "technical debt" which one day will have to be paid off.

      2009-04-29 Wed Apr 29 10:44 Ready for class 08 on Inheritance

      Questions are in [ 08.html ] , project 2 with one or more classes and a test program is due in.

      Quiz 2 will cover everything about classes including inheritance.

      2009-04-29 Wed Apr 29 08:44 Late work on overloading

      Chapter 11 pages 582 -- overloading

      assignment operator overloaded
        object2 = object2 + object1
      can you do
         object3 = object3 + object2 + object1..... or more?

      Yes.

      2009-04-29 Wed Apr 29 06:37 SSH

      The downloads for the Secure Shell SSH have disapeared. I have been told that you can get get a free copy of "PuTTY" which is almost as good by searching for it on the web. To transfer files I'm told that "filezilla" is good. Note: I've not used these so I can't tell you anything about them.

      2009-04-28 Tue Apr 28 14:04 Example of a conversion operator

      Here is a sample of converting a Date to a string ready for output [ conversion.cpp ] that also shows a clever way to convert numbers into strings...

      2009-04-27 Mon Apr 27 17:08 Next class -- Project 2 and Quiz 2

      Project 2 is due at the start of class [ 08.html ] and there will be a quiz on chpters 8 through 12... including the subject (Inheritance) for that day.

      2009-04-27 Mon Apr 27 11:06 Question on Overloading ready....

      [ 07.html ]

      2009-04-24 Fri Apr 24 13:46 Grades posted...

      [ grading/ ]


      Table
      Grade DistributionA/A-B+/B/B-C+/C/C-D+/D/D-F
      Frequency1161293

      (Close Table)

      2009-04-22 Wed Apr 22 11:20 Questions answered -- mostly

      A couple of questions were about the reading for the next class and will be answered then. The rest are online.

      Chapter 9 pages 494-496 -- Class Scope/ Identifier -- LATE

      On the board, can you give a simple c++ code using class scope and identifier?

      No time. This was Tuesday's topic.

      2009-04-20 Mon Apr 20 16:55 Added UML class from blackboard to web page

      I've added a graphic to [ 05.html ] based on the one I sketched on the board today.

      2009-04-20 Mon Apr 20 10:49 Grades posted.... ready for class 5 on Chapter 9

      2009-04-20 Mon Apr 20 10:48 Late Questions on Chapter 8

        Chapter 8 pages 411 -- Pointer Operators (LATE)

        can the variable yPtr have different values in the same program?

        Yes, that pointer can (1) refer to different int variables at different times, and (2) the pointer referes to a location that can have different values at different time.

        With pointers it can help to keep the "two values" distinct... the location refered to, and the value in that location.

        Chapter 8 pages 455 -- Pointers LATE

        Can you tell us more about what the computer does when it is told to use strcat

        It must be given two addresses in memory. It starts looking at the characters in one of the addresses, one at a time, going up, until it hits the char '\0' -- the null character. It then starts to copy the other string, starting with its first character being put on top of the null-character, then the other chars....

        For example, if we have memory like this
        Table
        Variable[0][1][2][3][4]
        s1ab0
        s2c0

        (Close Table)
        Then after strcat you get
        Table
        Variable[0][1][2][3][4]
        s1abc0
        s2c0

        (Close Table)

        Chapter 8 pages 428 -- size of operator

        What does the sizeof operator do exactly, and when do you use it?

        The compiler looks at "sizeof" and replaces it by a number indicating the number of bytes (chars) needed to store the data. It can be applied to a variable or the name of a type, or the name of a class.

        Notice it calculates the size as seen before the program runs. It will not tell you how much actual data is in a dynamic object at run time.

        Chapter 8 pages ppp-ppp -- classes

        why do we use classes?

        To make our program more understandable and easier to change. It has many independent pieces, all with a meaning. So we know where to find the code that needs changing.... and some idea of what to do with it.

        Don't forget -- chapter 10 is next.

      2009-04-17 Fri Apr 17 11:53 First grades posted on Monday

      I had planned to get all grading done and published by Friday afternoon.

      The first set will be ready by Monday afternoon.

      2009-04-15 Wed Apr 15 10:04 Deadline for chapter 8 has passed

      The deadline to get a oint by asking a question about chapter 8 has passed.

      I've posted questions and answers in to [ 04.html ] and may have time later today to add a few more.

      Don't forget -- today is Project+Quiz day. Also bring back your "sign up for grades" sheet.

      2009-04-15 Wed Apr 15 08:02 Chapter 7 is too late now

      The deadline to earn points for questions on topics in chapter 7 -- arrays and vectors was 10am on Monday. I will post quick answers here. You will have an oportunitiy to go back to previous a previous chapter in the last class before the final.

      To earn points today the questions must be on chapter 8 -- check [ 04.html ] and [ schedule.html ]

      We also have a project due today. If you want any points it must be handed in by the start of today's class.

      Next week we move on to chapter 10....

      Late Chapter 7 questions

        Chapter 7 pages 369-371 -- multidimensional arrays

        What can you do to avoid getting confused with row and column numbers in an array since column 1 is column 0; does the element have to begin at zero?

        All subscripts in C/C++ start at 0.

        All subscripts in C/C++ start at 0.

        All subscripts in C/C++ start at 0.

        Be very clear in your thinking and check every subscript you write, at least twice.

        Chapter 7 pages 378 -- Arrays

        Whats the difference between a one-dimensional and two-dimensional array?

        A one dimensional array has one subscript. A multi-dimensional array have more than one subscript. The Dimension of an array is equal to the number of subscripts.

        Chapter 7.9 pages ppp-ppp -- Multidimensional Arrays

        When referrencing an array element incorrectly as a[x,y] why does it only read only 'y' and not 'x'?

        The comma in an expression in C/C++ means: discard the first value

         		cout << ((1+2+3),(4+5+6)) <<endl;
        will output a single value -- 11. The 7 will vanish.

        Chapter 7 pages 365 -- arrays

        could you explian linear search for arrays a little better ??

        We must move on. We will return to searching and sorting later. Meanwhile try running the linear search algorithm on paper.

      2009-04-14 Tue Apr 14 16:32 Revized Lab schedule

      I've worked out the detailed schedule of topics [ schedule.html ] for the classes and that, in turn, forced me to rethink the later labs in the lab schedule: [ labs.html ] I still have a couple of holes to fill in labs 5 and 6.

      2009-04-14 Tue Apr 14 10:07 Style matters in Programming

      [ 001254.html ]

      Note: I tend to use three spaces per indent, except when I'm in a hurry and the program is short -- then its tabs.

      You should idnet your projects. For two reasons: (1) you will make fewer mistakes. (2) you'll get more points.

      2009-04-13 Mon Apr 13 10:32 Class 3 -- ready

      [ 03.html ]

      2009-04-08 Wed Apr 8 12:14 Your Questions have been answered

      [ 02.html ] (You may need to hit the "reload" button on your browser).

      2009-04-07 Tue Apr 7 15:15 Change in Project 1 Requirements

      I've just typed in some notes on your choice of first project [ p1.html ] which I hope helps you chose something you can do well at.

      I noticed a mistake.... Exercise 7.21 was not supposed to be an option. Please adjust your syllabus. Note: It won't get full credit because it doesn't include programming.

      2009-04-07 Tue Apr 7 05:58 Rethinking the labs

      I've got the first 4 labs to fit with the new book.... I'll be working on the rest later.

    1. Tue 14:59:19 OK! I've got a sequence that fits the book.... but expect the instructions for the labs will need more work done them...

      [ labs.html ]

      2009-04-01 Wed Apr 1 06:56 Why I hate arrays

      [ conficker-how-a.html ] (How to make a buffer overflow attack / virus).

      2009-03-23 Mon Mar 23 16:14 First rough draft schedules and syllabus online

      See [ schedule.html ] and [ syllabus.html ] to see how many mistakes I've made! Use [ contact.html ] to tell me about errors.

      2009-02-17 Tue Feb 17 06:02 Book for 2009

      Some one asked me what the book when I teach this class in the Spring quarter 2009. It is the same book (starting in Chapter 8) as cs201:

      Required Text "C++ How to Program" by Deitel and Deitel, 6th Edn., ISBN 0-13-615250-3. It should be in the book store. Used and cheap copies should be OK, but do not buy older editions. You can also read it, a page at a time, online, for free, on campus or through the Pfau Library Proxy.... This is only good for emergences.

      See you all in the Spring.

      Not I'll by revising this site "Real Soon Now". The schedule will change to fit the new book. The objectives and teaching techniques should be similar to what you find here.

      2007-06-15 Fri Jun 15 16:06 Grades include Bonus Points for Friday 15th


      Table
      Grade DistributionA/A-B+/B/B-C+/C/C-D+/D/D-F
      Frequency106502

      (Close Table)

      Most older entries redacted

      Millionare and our program

      This was sent to a colleague recently
      1. Subject: Thank you
      2. From: <Anonymous>
      3. Date: Sat, March 31, 2007 9:25 am
      4. To: concep@csci.csusb.edu

        My nephew may be attending Cal State shortly, so feeling a bit nostalgic, I decided to contact some of my professors. I'm not sure if you remember me, but I'm sure you remember my friend <anonimized> (yes, that was a joke). I admit that I thought most of your classes were a waste of time, but I was very wrong. I've built several successful companies, and now own a multi-million dollar corporation, all because of my knowledge and use of computer science. Since I graduated, I've found innovative ways to integrate my knowledge of computer science into every business I've owned. So, I suppose this is a thank you letter to let you know that I credit people like you with my success. If my nephew does attend Cal State (I'm trying to convince him), I'm recommending you as an instructor.


      Tue Dec 7 13:11:40 PST 2004 Draft Grades posted I finished grading the finals rather early this morning.

      Here is the current grade distribution for the course:
      Table
      Grades A/A-B+/B/B-C+/C/C-D+/D/D-F
      Frequency87201

      (Close Table)

      Tue Nov 23 09:44:51 PST 2004 Previous Final Posted

      I've decided to publish a copy [ final2002.pdf ] of the CSci2002 Final examination from Fall of 2002. This was a course based on a different book. There is no guarantee that the new final will be similar -- I always make some small changes, and the change to Scansholm forces to make some big ones. However the layout, format, instructions, and most of the content will be the same.

      Glossary

    2. Dia::="Diagram Editor", -- a free drawing tool for Linux and Windoze.
    3. FAQ::="Frequently Asked Question".
    4. STL::= "Standard Template Library". [ The Standard Library in resources ]
    5. TBA::= "To Be Announced".
    6. TBD::= "To Be Done".
    7. UML::="Unified Modeling Language", [ UML in resources ]
    8. UNIX::Operating_system= See http://www.csci.csusb.edu/dick/cs202/resources.html#UNIX.

    . . . . . . . . . ( end of section CS202 Web Site) <<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