(Latest Revision: 09/14/2000)
Week 02 Notes for CS 2500 -- Fall 2000
Monday, September 11
- Take Roll.
- Pass out accounts
- See if anyone needs to be shown how to telnet from
a PC.
- Show people how to launch a browser and editor.
- Do "Hello World" Assignnent
- Where to get hello world handouts
and Jove handouts online:
Wednesday, September 13
- Take Roll.
- Announcement: Combined AMP Computer Science review
sessions for CS 1500 and CS 2500 will commence on
September 19. Sessions will be held in P-280
according to the following schedule:
- Tuesdays 4:00 pm - 4:50 pm
- Wednesdays 12:20 pm - 1:10 pm and 3:35 pm - 4:25 pm
- Fridays 2:10 pm - 3:00 pm
- Show the class a sample of what they should have
turned in for the "Hello World" assignment.
- In Carrano we are reading chapter one (program design) and
chapter two (recursion).
- In Anderson we are reading chapters 1-3,5 (intro to Unix).
- Programming assignment #1 is due in less than two
weeks.
- Discuss top-down program design methodology using
online examples of level-one through level-three
programs.
- Discuss the design of the solution to program #1.
Discuss help and hints.
- First create a header comment for the program.
Use the specs in the assignment to create your
description of what the program does.
- Invent your algorithm: Conceive of a method for solving the problem.
The method must involve just a few steps. Keep the number of steps
small by not including much detail at this level. A function must not
take up more than about 24 lines of code (a "screenfull"). Less is better.
- The algorithm must be complete: All required
tasks of the algorithm are covered by the steps given,
even though many details may not be explicitly mentioned.
- The steps of the algorithm must be in the correct order.
- Any loop, if-else, or other control structure must be written correctly.
- Next translate the algorithm into C++, making it into your main function.
- Make "steps" of the algorithm into function calls in the main function.
Include parameters in the calls.
- Create stubs for the function calls in the main program.
- Begin each stub by writing a header comment telling
what the function will do when completed. (In other words,
the header does not tell what the stub function does. It
tells what the completed function will do.)
- Next write code for the stub function.
Usually a stub writes a message to let the user know when it is executing.
The stub must also return a value if the caller expects one.
If the caller expects the function to set the values of other parameters
or variables, the stub must do that. Usually the programmer just arbitrary
values for the stub to return/set.
- Compile and test the program. Fix any problems with the main function and stubs.
- When everything checks out, start expanding stubs into completed functions. How do you do that?
Basically you just do the steps above all over again. Now you are working on a function at
the next level down instead of the main function. You must still defer detail. Include only enough
detail at each level so that the function has just a few steps.
- You work like this over and over, going down level-by-level.
Eventually, there will be steps to fill in that are so simple
that they can be coded directly into just one or two C++ statements.
Once you reach this "bottom level" everywhere in the program, you are finished writing it.
Friday, September 15
- Take Roll.
- Show example of reading e-mail on the Sun Ultra's.
- Discuss the class mailing list (majordomo::cs2500-1)
- More discussion of the programming assignment.
- There is an implementationHints document
now. Let's go over that.
- A level-two version of the program is due on
Monday. Let's make sure we all understand
what you have to turn in.
- The compiler command option for naming the
executable file:
(g++ -o decode decode.cpp)
- Discuss compiling/debugging with jove
- How to execute the compiler "inside" jove:
(C-u, C-x, C-e)
- How to break out of jove to a sub-shell
whilst "saving your place": (M-s)
- Testing the program while in the sub-shell.
- How to break out of the sub-shell and return
to "your place" in jove: (exit)