LIST OF EXAMPLES USED IN LECTURES

 

#

Titles

Files ( all in /examples) LINKS

1

The first three examples

threecppexamples.txt

2

A Sample Program

1ex1.appended

3

Input Output Files in C++ < fstream.h>

2ex1.appended ( using 2ex1dat.txt )

4

If statement

2ex2.appended

5

Nested IF Statements

2ex3.appended

6

Switch Statements

2ex4

7

While Loop

3ex1.txt

8

The for statement

3ex2.cpp

9

Using fixed formats

4ex1.appended

10

Using scientific formats

4ex2.appended

11

Double variables and fixed formats

4ex3.appended

12

An example on Newton's method of root finding

4ex4.appended

13

An example on functions. Returning a single value

5ex1.appended

14

Another example on functions. Returning no value

5ex2.appended

15

Another example on functions. Multiple returns

5ex3.appended

16

Bisection Method. An example of recursive use of a function

5ex4.appended

17

Arrays. Reading from file

6ex1.appended ....and ..... the data file

18

Arrays. Storing factorials in an array

6ex2.appended

19

Arrays as arguments of functions

6ex3.appended

20

Arrays. Average value and Standard deviation of a list of scores

6ex4.appended

21

Reading from files. Skipping lines and the .getline() function

7ex1.appended

22

Numerical Differentiation

Spreadsheet file numdif.htm

23

A simple minded trapezoidal integration in C++

8ex1.appended