One experiment needs the CCC graphic library and can not be run remotely.
Can you change it so that instead of a square table it outputs a triangle:
1
2 4
3 6 9
...
10 20 30 ... 100Hint: change just one const identifier to a variable...
Your task is to make it try out 10 times as many point to see if the circle is filled in.
g++ -o largest largest.cppTry to figure out what I have deleted from it.
Fix it, compile, and test it by running this command
./largestinputting some numbers, and (on a blank line) after the data send a End-Of_Transmission signal: hold down the Control key and tap the letter D.
Make sure it handles missing data and a series of numbers.
Otherwise fix it!
cp largest.cpp smallest.cpp(or use the GUI desktop)
Change smallest.cpp so that it outputs the smallest of the input numbers rather than the largest.
The mean of a list of numbers is found by adding them up and dividing by the number of numbers:
So you need to both count the size of the sample -- the number of numbers and also add them up.
(Hint: Start by writing some examples of what you want by hand. Then it often helps to draw a picture of how a program behaves or to describe the inputs and what happens to them. Then work on the source code. )
First fix the syntax errors.
Then test with as many test inputs that you can think of. Make sure your program is error free.
Getting this far by the end of the lab gets you an A for the lab.
| Who | When |
|---|---|
| Kay Zemoudeh | 12/9/1997 |
| Dick Botting | 02/02/2010 |
. . . . . . . . . ( end of section CSci201 Laboratory 05 -- decisions and loops) <<Contents | End>>