Assignment #3 - 84B

# Assignment #3 - 84B

```ASSIGNMENT 3                                       DUE: 13 OCT 84
------------                                    WEIGHT: 25

A 1000-FOOT CABLE IS STRETCHED BETWEEN TWO TOWERS, WITH A SUPPORTING
TOWER MIDWAY BETWEEN THE TWO END TOWERS.  THE VELOCITY OF THE CABLE
CAR DEPENDS ON ITS POSITION ON THE CABLE.  WHEN THE CABLE CAR IS WITHIN
30 FEET OF A TOWER, ITS VELOCITY IS GIVEN BY:

VELOCITY = 2.425 + 0.00175 (D**2)     FT/SEC

WHERE D IS THE DISTANCE IN FEET FROM THE CABLE CAR TO THE NEAREST TOWER
( D**2  = D RAISED TO THE POWER OF TWO).
IF THE CABLE CAR IS NOT WITHIN 30 FEET OF A TOWER, ITS VELOCITY IS
GIVEN BY:

VELOCITY = 0.625 + 0.12 D - 0.00025 (D**2)    FT/SEC

PRINT A TABLE AS THE CABLE CAR ADVANCES FROM THE FIRST TOWER TO THE
LAST ONE, IN INCREMENTS OF TEN FEET.  AT EACH INCREMENT OF TEN FEET, YOU
SHOULD PRINT THE CAR'S VELOCITY IN FT/SEC, ITS DISTANCE IN FEET FROM
THE FIRST TOWER, AND THE NUMBER OF THE NEAREST TOWER (1=FIRST, 2=MIDDLE,
3=END).   WRITE TWO PROGRAM SOLUTIONS.  ONE OF THE SOLUTIONS SHOULD USE
THE IF-THEN-ELSEIF-ENDIF CONSTRUCT AND THE DO LOOP.  WRITE THE OTHER
SOLUTION ASSUMING YOU DO NOT KNOW THESE STRUCTURES YET, SO USE IF
STATEMENTS AND GO TO'S.  BOTH PROGRAMS SHOULD PRODUCE THE SAME OUTPUT.

BY DOING THIS ASSIGNMENT YOU SHOULD NOTE THAT THE PROGRAM WITH THE
IF-THEN-ELSEIF-ENDIF CONSTRUCT AND THE DO LOOP IS EASIER TO WRITE AND
READ THAN THE ONE USING GO TO'S.  (GO TO'S TEND TO MAKE A PROGRAM
SPAGHETTI-LIKE!).

REMEMBER THAT BOTH OUTPUTS YOU PRESENT SHOULD HAVE APPROPRIATE HEADINGS
AND TITLE.  I WOULD ALSO APPRECIATE IT IF YOU USE MEANINGFUL VARIABLE
NAMES AND INDENTATION IN YOUR PROGRAM, AS WELL AS BLANK COMMENT
STATEMENTS TO SPACE OUT YOUR PROGRAM.  THAT MAKES LIFE EASIER WHEN
YOU DEBUG YOUR PROGRAM, AND WHEN I GRADE THE ASSIGNMENTS!  ALSO DON'T
FORGET TO PUT YOUR NAME AND STUDENT NUMBER.
```