Radio Shack TRS-80 Model 100 Basic Manual page 56

Basic language lab
Hide thumbs Also See for TRS-80 Model 100:
Table of Contents

Advertisement

Run the program with a sales amount of 1111. In this case you can see that in the
output of the commission
.......... $166.65
the unused positions are, indeed, padded with the "*,, symbol.
Large dollar amounts are usually printed with commas. Try changing line 45 to
45 A$
=
"**$###,###.##"
Run the program with a sales amount of 123456. In the output of the commission,
***$42,809.60
the digits are now separated with a comma to make the reading of the number easier.
If
your number requires more columns than you have specified, for example printing
34.56 with "#.###", the number will be printed anyway, but the symbol
"%"
will
be
printed to the left of the number to indicate the field overflow.
Experiment #5 Sales Commission Revisited
Change the sales commission program so that it is computed according to the
following scheme:
if sales are $2000 or under, commission is 15% of sales
if sales are over $2000, commission is 20% of sales
The program must now make two different computations depending upon the total
sales.
The program is illustrated with the flow chart in figure 4-2. The branching can be
accomplished with the use of a variation of the IF/THEN statement, called the
IF/THENIELSE statement.
50

Advertisement

Table of Contents
loading

Table of Contents