(Latest Revision: 09/15/2001)
Week 03 Notes for CS 1500 -- Fall 2004
- Take roll.
- Check schedule
- Announcements
- (Revised) tutoring hours.
- Discuss compiling/debugging with jove
- How to execute the compiler "inside" jove:
C-u, C-x,C-e
then erase "make" by doing C-h four times, then type the
compiler command such as
g++ p1.cpp
- C-x 1 "unsplits" the screen.
- How to break out of jove to a sub-shell whilst "saving your
place": (esc-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)
- Note that using JOVE as above makes debugging go easier.
- If interested, you can read the
compileHelp document for more information about using JOVE for
compiling and debugging. This document is in the General_Info section of
the class web space.
- Each Sun is equivalent to the others.
- Discuss simple C++ constructs
- use of cout stream
- Using string expressions with cout <<
- Using arithmetic expressions with cout <<
- use of endl
- using functions -- good for parts of programs that have to be
repeated.
- Look at the sample program of lab #1 -- illustrate the type of work
that the students will do:
- Compile and run a copy of the program.
- Stash a copy of the resulting output.
- Inserting a comment and alter the "cout" statements slightly.
- Compile and re-run the program.
- Notice where the new output is different, and where not different.
- Discussion of solo program #1 -- look at the things in the assignment
directory and use them to help give a description of what the solution to
the assignment problem will "look like."
- Discussion of sample programs and the new programming concepts they
illustrate.
- use of cout stream (e.g. ex0201.cpp)
- Using expressions with << (e.g. ex0201.cpp)
- use of endl (my_example.cpp)
- using functions (my_example.cpp)
- int's versus float's
- declaring and naming variables (e.g. ex0201.cpp,
ex0202.cpp, ex0205.cpp)
- assignment statements, lvalues, rvalues (e.g. ex0201.cpp,
ex0205.cpp)
- separate and combined declaration-initialization (e.g.
ex0205.cpp)
- integer arithmetic -- including surprises about integer division
(e.g. ex0205.cpp)
- modulus operator % and unary - (e.g. ex0205.cpp)
- operator precedence (my_example.cpp)
- interactive programs (e.g. ex0220.cpp)
-
- Demonstrate some tasks that will be needed in lab #2. (Mainly these are
the things seen in boldface above.)
-