EasyManua.ls Logo

Atari 65XE

Atari 65XE
135 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
MATH PROGRAMS
The computer's mathematical functions can be used for work pur-
poses, as well as for play. If you were a chef who prepared food for
banquets, you might need a computer to expand your recipes. For
instance, suppose that you are trying to figure out how many pounds
of sea scallops to buy to serve Coquilles St. Jacques at a dinner for 62
guests. Your recipe indicates that 1 1/2 pounds of scallops feeds 5
people. The program below would tell you how many pounds to buy:
NEW
1 REM *** COQUILLE ***
10 PRINT " "
20 GUESTS=62
30 POUNDSTOBUY= 1.5/5 * GUESTS
40 PRINT:PRINT "BUY ";POUNDSTOBUY;" POUNDS OF
SCALLOPS."
50 END
The program produces the answer (18.6 pounds of scallops), but a
calculator would achieve the same result with less work To make the
program more useful, allow a variation in the number of guests by in-
serting an INPUT statement. Type in the additional lines below:
15 PRINT : PRINT "HOW MANY GUESTS DO YOU EXPECT?"
20 INPUT GUESTS
Run the program several times, entering a different number of guests
each time. The amount of scallops needed changes each time. For
200 guests, 60 pounds of scallops are required; for 436 guests, 130.8
pounds. The INPUT function makes the program more practical.
53

Related product manuals