Assignment #2
- We need to use a function called sleep(int) that suspends
the execution of the program by the number of seconds.
- The function sleep is available only for DOS
- #include <dos.h>
- choose Application as the target type
- DOS standard as the platform
- For each one of the loops given in the assignment create a
type: first, second, third
- All of these types are used with the template timer and they
redefine the work function using the code given in the assignment
Sample output:
n | first | second
| third |
100 | 1 | 1
| 1 |
1000 | 12 | 144
| 140 |
.... | .... | .....
| ..... |
| | |
|
| | |
|
| | |
|
- In main, you will have three variables say f, s, t of the
type first, second, and third
- Three different timer types timer<first> one; timer<second>
two; timer<third> three;
for(int j = 2; j < 10; j++)
{
cout << one.timed(j,f) << '\t' << two.timed(j,s)
....
}