(Latest Revision: 09/11/2003)
Week 02 Notes for CS 2500, Section 001 -- Fall 2003
CS 2500, Section 001, Monday, Septemember 08, 2003
Notes for Lab Day
- Meet first day in lab to do hello world assignment
- Take Roll.
- Announcement(s)
- Anyone who still needs to add CS 2500 should contact me
- A level-two version of program #1 is due Monday, September 15
Get started on this soon, while the Hello
World! assignment is still fresh in your mind.
- Locate where to get Hello World! handouts and Jove
handouts online:
- check out the links from the Hello World! handout.
CS 2500 Notes for Rest of Week
- Take Roll.
- Pass out any left-over accounts.
- Discuss with class what they should have turned in
for the "Hello World" assignment.
- Look at file that tells results of lab 01 (Hello World!)
- 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).
- Final due date for Programming assignment #1 is Wednesday, September 24
- Perhaps finish up from last week or do some lecture topics from below.
- Discuss programming assignment #1.
- What is the assignment?
- How do we get the data files?
- Where do we put the data files?
- Gotcha's
- Design considerations -- how does the top-down design work?
- Information to put in function headers
- What do you have to turn in on Monday?
- What does a level-two program look like?
- What should this level-two program look like?
- The level-two program needs documentation for the main program,
for the functions called by the main program (they are called
level-two functions), and for the functions called by
the level-two functions (they are called level-three
functions.)
- The documentation for every function must tell what the
function will do when it is completed. (Normally you
don't write documentation to tell what a stub function does.)
- In the level-two program you need to finish the code for the
main function and all the level-two functions.
- In the level-two program you need to have stubs for all the
level-three functions.
- If you follow my suggested design the main program will have
some declarations of variables, perhaps some function
prototypes, perhaps an initial call to askPermission, and a
loop containing calls to getParams, getImage, doTileJob, and
askPermission.
- In your level-two program you can probably put versions of
askPermission, and getParams that don't make calls to any
level-three functions (except 'built-in' functions that you
don't need to write).
- Depending on how you want to design the program, you may want
getImage to call a level-three function that you write. On the
other hand you may not want to do that.
- I think doTileJob really has to call a level-three function to
do most of the work. I think doTileJob is bound to be too long
and 'busy' if you try to write it without a lot of reliance on
a level-three function.
- getImage and doTileJob are both functions that could be written
with the basic structure of a for-loop.
- getImage can begin by
- getting the height and width of the image,
- setting up to begin reading on the first character of
the next line, and
- then performing a loop: "For each row index i from 0
to heightOfFileImage-1 get the characters in the next
line in the image file and put them in row i of the
buffer array."
The function that puts the next line of the file into the
buffer can be a stub in your level-two program. You can
put off figuring out how to do that part of the problem
until after Monday.
- The basic structure of doTileJob could be "For each row
index i from 0 to numberOfRowsInTheTiling, make a row of
numberOfColumnsInTheTiling 'tiles' across the standard
input (you have to do it by copying characters out of the
buffer array). The function that makes the row of tiles
can be a stub in your level-two program. You can put off
figuring out how to do that part of the problem until
after Monday.
-
- Look at "What you have to turn in" for Monday on the assignment
sheet.
- Discuss program testing strategies and requirements.
- Data Coverage -- Black Box Testing
- Average inputs
- inputs near and on boundaries
- Code Coverage -- White/Clear Box Testing
- Statement Coverage
- Path Coverage
- Show example of reading e-mail on the Sun Ultra's.
- The compiler command option for naming the executable
file:
(g++ -o letters letters.cpp)
- Discuss compiling/debugging with jove
- How to execute the compiler "inside" jove: (C-u, C-x,
C-e)
- C-x 1 "unsplits" the screen.
- 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)