12.07.2015 Views

page-1983-101-timex-sinclair-programming-tricks

page-1983-101-timex-sinclair-programming-tricks

page-1983-101-timex-sinclair-programming-tricks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Unit price is total price divided by quantity. The quantitycan be expressed in weight, total numbers, etc. It worksthe same whether you are talking about pounds of coffee,yards of concrete, gallons of ice cream, boxes of books,or units of Widgets.This program asks for the name of the item, quantitypurchased and total price paid. It then displays quantity,name, total and unit price.Program Listing10 LET U=J620 PRINT nITEM NAME IS n;30 INPUT N$40 PRINT N$50 PRINT nQUANTITY OF ITEMS = n;60 INPUT Q70 PRINT Q80 PRINT nTOTAL PRICE PAID FOR ITEMS=$";90 INPUT P100 PRINT P110 LET U=P/Q120 PRINT N$;n UNIT PRICE = $";USample RunITEM NAME ISWIDGETSQUANTITY OF ITEMS =999TOTAL PRICE PAID FOR ITEMS = $14653BEEP WIDGETS UNIT PRICE = $14.66766878 Bubble SortHere's a handy routine, accepting lists of up to 10names and sorting them into alphabetical order. The sizeof the list is controlled by the DIM instruction in line 20.You can change it.97

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!