In-class Examples List
CIS 130
Intro to Programming
Spring 2010
Last modified: Tue May 4 20:41:56 PDT 2010
Important Notes:
- This is merely a selection of files and examples, most of which were
mentioned or used in the class (lectures and labs). It is not a
comprehensive
list, nor are all lectures and labs included. Formatting is generally
minimal.
- Week 15, Monday, May 3, 2010 - C++ switch statement, intro
to C++ fstream file input/output (and bonus formatting
examples)
- Week 14, Wednesday, April 28, 2010 - output parameter/pass-by-reference
parameter examples; example of debugging couts
- Week 14, Monday, April 26, 2010 - input parameters, output parameters,
and input/output parameter; parameters passing: pass-by-value
and pass-by-reference
- Week 13, Wednesday, April 21, 2010 - introduction to
arrays
- Week 13, Monday, April 19, 2010 - more repetition:
counting the number seen in a sentinel-controlled loop,
finding the maximum value seen, counting how many of
a particular kind of value seen; "question"-based loop;
a loop that is neither count-controlled, sentinel-controlled,
or "question"-based; also generating a flaky random-ish
number in C++
- Week 12, Wednesday, April 14, 2010 -- more repetition:
practice writing count-controlled loops, introduction
to sentinel-controlled loops
- Week 12, Monday, April 12, 2010 -- intro to repetition:
basic while loops
- Week 9, Wednesday, March 24, 2010 - C++: intro to
interactive input and output (using iostream library
object cin and cout); definition of a C++ program;
writing a main function; compiling and linking C++
functions to create a C++ program
-
in-lecture projections
-
main_template.txt
- function
get_word
,
a function with NO parameters, that
expects nothing, does interactive input,
and returns something:
get_word.h,
get_word.cpp, and the testing function
get_word_ck_expect.cpp
- function
greeting
,
our first void function:
greeting.cpp ,
greeting.h ,
greeting_ck_expect.cpp <-- EDITED to
JUST call void function greeting; compiled
using:
g++ -o greeting_ck_expect greeting_ck_expect.cpp greeting.cpp
- a main function calling greeting and get_word:
greet_word.cpp ,
compilable using:
g++ -o greet_word greet_word.cpp get_word.cpp greeting.cpp
- Week 9, Monday, March 22, 2010 - C++: introduction
to mutation: assignment statements, += et al, and ++
- Week 8, Wednesday, March 10, 2010 - C++: a function
that calls another function, a function involving
strings, and introducing the C++ if statement
-
in-lecture projections
- function
ring_area
, which uses
circ_area
:
ring_area.h,
ring_area.cpp, and the testing function
ring_area_ck_expect.cpp
- function
pretty_name
, which involves strings:
pretty_name.h,
pretty_name.cpp, and the testing function
pretty_name_ck_expect.cpp
- function
abs_value
, which has an if-statement:
abs_value.h,
abs_value.cpp, and the testing function
abs_value_ck_expect.cpp
- function
spiciness_level
, which
has a multi-way-branching style if-statement:
spiciness_level.h,
spiciness_level.cpp, and the testing function
spiciness_level_ck_expect.cpp
- Week 8, Monday, March 8, 2010 - C++: more function
examples
- Week 7, Wednesday, March 3, 2010 - Intro to C++!
- Week 7, Monday, March 1, 2010 -
more examples: conditional expressions, design recipe
template step, figuring out how many specific tests/
examples you need when there are multiple cases,
more working with intervals, etc.
- Week 5, Wednesday, February 17, 2010 -
branching/conditional expressions;
adding in the TEMPLATE step to the design recipe (step 4);
writing and reading intervals;
to read another presentation of some of this, see
section 2.4 of
"How to Design Programs",
2nd edition
- Week 4, Monday, February 8, 2010 - using functions and
definitions to achieve a desired end: simple animations;
to read another presentation of some of this, see Section
1.2 of the
Prologue of
"How to Design Programs",
2nd edition
- Week 3, Wednesday, February 3, 2010 - introduction to the
design recipe, using it in designing your own operations/
functions;
to read another presentation of the design
recipe, see
section 2.3 of
"How to Design Programs",
2nd edition
- Week 3, Monday, February 1, 2010 - defining your own names,
(including importing an image from outside of DrScheme and
giving it a name), first example of defining your own operation/function
- Week 2, January 25, 2010 - simple and compound expressions -
partially based on
the beginning of the prologue through section 1.1 of
"How to Design Programs",
2nd edition
Back to Course Home Page
Please send questions to
st10@humboldt.edu .