WEEK03
May 24 and May 26
This page contains lectures, examples and assignments for week 3
of the class "Introduction to Scientific Programming".
Lectures:
Examples:
-
7.txt,
the output from the popcorn iteration for 7.
-
7.png,
gnuplot: plot "7.txt" with lines.
-
27.txt,
the output from the popcorn iteration for 27.
-
27.png,
gnuplot: plot "27.txt" with lines.
-
64.txt,
the output from the popcorn iteration for 64.
-
64.png,
gnuplot: plot "64.txt" with lines.
-
divisible.cpp,
looking for a divisor of the number n.
-
gates.cpp,
how to win $1,000 from Bill Gates.
-
interval.cpp,
a program which reads a value X and reports if it lies inside
the interval [3,17].
-
lights_out.cpp,
a program to play the "Lights Out" game. Compile it with
"g++ lights_out.cpp -lglut".
-
lights_out.png,
a screen shot from the "Lights Out" game.
-
quadrant.cpp,
a program which reads values X and Y and reports which quadrant (X,Y)
is in.
-
truck.cpp,
how an overloaded truck must reduce its weight to cross a bridge.
Assignments:
-
In class exercise #3, on Tuesday: we will write and run a program to
estimate the square root of a number.
-
Program Homework #1 is due on Thursday. Please mail your program and output
to Detelina, or turn in printed copies.
-
Program Homework #2, to be assigned on Thursday, requires you to write a program
to carry out the popcorn iteration.
You can go up one level to
the ISC course page.
Last revised on 25 May 2011.