Assignment #3 - 92B

# Assignment #3 - 92B

```                           ASSIGNMENT 5
WEIGHT: 30
DUE: 9  NOVEMBER 92
TA: L. Bernier
E-Mail to HDLV

!!! NOTE:  This assignment has been updated !!!
===============================================

1. Now due 9th November
2. Increment can be a simple 0.2
3. Graph width reduced to fit the screen
4. Any other ideas to make it easier?

BESIDES USING THE COMPUTER TO COMPUTE LIST OF VALUES, ONE CAN ALSO
USE THE COMPUTER TO PLOT THE VALUES IN GRAPHICAL FORM.  THE GRAPH WILL
CONSIST OF DOTS "...." FOR THE AXES AND A CROSS "X" FOR EACH COMPUTED
POINT (X,Y) OF THE GRAPH.  BY PLOTTING A SUFFICIENT NUMBER OF POINTS OF
THE GRAPH, WE OBTAIN A PICTURE OF THE GRAPH.  THE ALGORITHM IS GIVEN
BELOW.

OUR GRAPHS WILL CONSIST OF 50 LINES AND EACH LINE WILL CONTAIN
60 CHARACTERS (' ', '.' OR 'X').  WE CHOOSE THE HORIZONTAL AXIS AS THE
Y-AXIS AND THE VERTICAL AXIS AS THE X-AXIS.  SINCE EACH VALUE OF X GIVES
A UNIQUE VALUE OF Y, WE CAN CALCULATE AND PLOT OUR GRAPH ONE LINE AT A
TIME. CONSEQUENTLY, WE WOULD REQUIRE ONLY A LINEAR ARRAY WITH 60 CELLS.

ASSUMING WE ALWAYS WANT TO PLOT OUR FUNCTIONS FOR -2.9 <= X <= 3.0,
AND THE RANGE OF Y FOR THESE VALUES ALWAYS LIE BETWEEN -29.0 AND 30.0,
THEN WE HAVE THE FOLLOWING STEPS:

1. SET X EQUAL TO ITS MINIMAL VALUE
2. FIND THE CORRESPONDING VALUE OF Y
3. SCALE THE VALUE OF Y TO AN INTEGER J BETWEEN 1 AND 60
-->  HERE, WE ARE GIVEN THAT Y LIES BETWEEN -29
AND 30.  ADDING 31 TO Y AND ROUNDING OFF
THE RESULT WILL GIVE A POSITIVE INTEGER
BETWEEN 1 AND 60.
4. PRINT A LINE WITH A CROSS(X) IN COLUMN J OF THE GRAPH
-->  REMEMBER TO PRINT A DOT FOR THE COLUMN
WHICH REPRESENTS THE X-AXIS, AND TO PRINT
A WHOLE LINE OF DOTS WHEN THE LINE REPRESENTS
THE Y-AXIS.
5. INCREMENT THE VALUE OF X BY ((2.9 - (-3.0)) / 50)AND
REPEAT STEPS 1-4 AS LONG AS X DOES NOT EXCEED ITS
MAXIMUM VALUE.
!! OR !!

It can be a simple value like 0.2 - your choice!
================================================   <<<<<<<<<<<<<<

THE FUNCTIONS YOU WILL HAVE TO PLOT IN THIS ASSIGNMENT WILL BE
OF THE FORM :
3     2     1
Y = AX  + BX  + CX  + D

FOR EXAMPLE, THE GRAPH OF THE FUNCTION Y = X -1 WOULD LOOK LIKE :

GRAPH OF A FUNCTION

X     Y
-3.00  -4.00             X                  .
-2.80  -3.80              X                 .
-2.60  -3.60               X                .
-2.40  -3.40                X               .
-2.20  -3.20                 X              .
-2.00  -3.00                  X             .
-1.80  -2.80                   X            .
-1.60  -2.60                    X           .
-1.40  -2.40                     X          .
-1.20  -2.20                      X         .
-1.00  -2.00                       X        .
- .80  -1.80                        X       .
- .60  -1.60                         X      .
- .40  -1.40                          X     .
- .20  -1.20                           X    .
0.00  -1.00        ....................X..............................
0.20  -0.80                             X  .
0.40  -0.60                              X .
0.60  -0.40                               X.
0.80  -0.20                                X
1.00   0.00                                . X
1.20   0.20                                .  X
1.40   0.40                                .   X
1.60   0.60                                .    X
1.80   0.80                                .     X
2.00   1.00                                .      X
2.20   1.20                                .       X
2.40   1.40                                .        X
2.60   1.60                                .         X
2.80   1.80                                .          X
3.00   2.00                                .           X

( NOTE THAT YOUR GRAPHS WILL BE TWICE AS BIG )

TEST YOUR PROGRAM WITH THE FOLLOWING 2 FUNCTIONS:

3     2
Y = 2X  - 1X  - 22X + 21

2
Y = 8X  - 32

This is the first assignment to be done in Turbo Pascal on DOS
based microcomputers.  It is an easy assignment from a programming point
of view.  To do it you have to learn

1. How to create an account on the HP Vectra in G15 MacDonald
Harrington Building = d'Ombrain Lab
2. Learn the basic NOVELL/DOS commands
3. Learn the Turbo Pascal Integrated Development Environment (IDE)
4. Learn the Turbo Editor.
5. Learn the Pascal syntax.
6. Debug a simple program.
7. Learn net3270 to logon MUSICB from the d'Ombrain Lab
8. Submit your assignment and output by E-Mail from the lab.
```