Calculators

Reference / Paper · 1981

TRS-80 Pocket Computer Programs

Read the PDF ↗

Jim Cole's book of fifty ready-to-run programs in Pocket BASIC for business, education and fun, sold by Radio Shack (cat. no. 62-2066); also published by Artsoft.

Author
Jim Cole
Year
1981
Type
Reference / Paper
Credit
Radio Shack; scan via the Internet Archive.

← Back to the Reference Library

TRS-80 Pocket Computer Programs

ei Cat. No. 62-2086 By Jim Cole 50 ready-to-run programs in Pocket-BASIC, including: BUSINESS Hourly Wages/Overtime « Pocket Datebook « _ Unit Cost » Commissions « Advertising Cost-per-1000 » EDUCATION Math Drill * Metric Conversion « Averages « Temperature Conversion * Slope & Distance + Factors » HOME Compound Interest * Checking Account Balance « Simple Interest * Mortgage Loan * Whodunit? « Craps « Old West Shootout « Klingon Killer » And many more! TRS-80° POCKET COMPUTER PROGRAMS By Jim Cole PRINTED IN USA FOR Radio Shaek A DIVISION OF TANDY CORPORATION FORT WORTH, TEXAS 76102 ©1981 by ARCsoft Publishers, Woodsboro, MD 21798 Reproduction of the content of this book, in any manner, without express permission of the publisher, is prohibited. No liability is assumed with respect to the use of the information herein. ISBN 0-86668-902-8 Preface We are convinced that the Pocket Computer is the wave of the future. Miniaturization and portability con- tinue to be major design goals in all areas of electronics: TV, stereo, amateur radio, calculators, auto, home, etc. The same applies to computers. It’s not hard to visualize engineers marrying the Pocket Computer with handheld printer technology since small printers already exist in pocket calculators. And it’s not hard to imagine memory chips which could expand the present 1.9k of memory to 16k or even more RAM, plus an elaborate, friendly operating system atop a superex- panded BASIC in ROM. Even the miniature, flat-screen LCD television display technology could be used for graphics and multi-line displays. All this in the handheld package! The “‘small’”’ desktop computers of the late 1970s and early 1980s will be the museum pieces of the late 80s and early 90s. Jim Cole 14 15 18 19 19 21 21 23 23 25 26 27 28 29 30 30 32 34 35 39 40 4 44 Table of Contents Introduction Business Programs Profit Estimator Hourly Wages, With Overtime Pocket Datebook Advertising Cost-per-Thousand Advertising Cost-per-Unit Sold Unit Cost Mark-Up: Standard Percentage Mark-Up: Manufacturing to Retail Mark-Up: Wholesale to Retail Making Change Invoice Totaling Salesman’s Commissions Rounding Cents to Nearest Penny Yes/No Executive Decision Maker Adding Numbers: One-Key Entry Education Programs Grade Scoring Slope and Distance dB Flash Cards Math Drill Smart Computer Frequency and Wavelength Metric Converter Factors 45 47 47 49 50 52 53 55 55 57 57 58 59 60 63 64 66 67 71 72 72 73 74 75 76 78 Ohm’s Law Reciprocals Memory Tester Pythagorean Theorem Averages Temperature Conversion (F,C,K) Rounding Off Numbers Fractional Portion of a Number Which Number is Largest? Programs For The Home Deposit Doubler Simple Interest Compound Interest: Present Value Compound Interest: Future Value Timer Checking Account Monthly Balancer Mortgage Loan Random Number Generators Random Numbers: Averages Beep Commander Whodunit? Klingon Killer Parameters Craps Cylon Raider Alert Old West Shootout Introduction There’s strong demand for useful software for microcomputers. Games have bloomed everywhere while practical, serviceable programs for the home, school and office have been in short supply. This volume, second in our series of 5programbooks written and tested on the TRS-80 Pocket Computer, provides more than 50 ready-to- run work-doers and time-savers. As noted in the first volume in this series, Murder In The Mansion and Other Computer Adventures In Pocket- BASIC For The TRS-80, working in the Pocket Computer’s version of the BASIC language requires a sharp editing pencil. Remarks, software explanations and lengthy strings are out. Honing, fine tuning and waste trimming are in. Take Profit Estimator, one of our handy business- office programs in this volume. When the idea occurred to me, | wrote it out at great lengthon a Pocket-BASIC Coding Form programming worksheet. It originally re- quired five worksheets! That’s 150 program lines. But that was only the warmup. The real work was in pruning it down to a slim, trim 38 lines of code. Cutting the fat out of programs for the Pocket Com- puter is worthwhile since | now can retain several dif- ferent work programs in the computer at the same time. Using the Def mode, | can call on just the right program for the right job at the right time. Even though they may be headed toward the same goal, no two programmers will write exactly the same list 6 of lines in BASIC. | know, as you load the programs in this book into your computer, you’ll make modifications to suit your own needs or interests. The author would like to hear of improvement suggestions as well as ideas for future volumes in this series. You can write the author in care of ARCsoft Publishers, P.O. Box 132, Woodsboro, MD 21798. These programs will run on any microcomputer set up for BASIC. If you are using a system other than the TRS-80 Pocket Computer or Sharp PC-1211, be on the lookout for statements which differ in the version of BASIC used by your machine. For example, PRINT and PAUSE commands used here may be different on your machine. Line numbers may be required rather than labels sometimes used here. ABC multiplication may have to be changed to A*B"C for- mat. Logical tests used here may have to be stated dif- ferently on other computers. Your machine might not ac- cept symbols for Pl and square root and SIN as we use them here. You may have to renumber program lines if your system requires it. The BASIC set used on the Pocket Computer is very powerful. Not at all a toy, the Pocket Computer is able to squeeze very elaborate, useful programs into its 1.9k memory. Editing is easier than on most other systems. Running is a joy. Slow speed is a worthwhile payment for hand-size portability. Many of the programs in this book could be used as portions of larger listings, as subroutines or GOTO ob- jects. To do so, make appropriate changes to the first line (usually 10) and the last line of each program. If you wish to create a subroutine, RETURN must be the last line of the small program. If you work one of these into a larger program as a subroutine, be especially careful of your memory labels. They must agree with your selection of labels for the main program. It’s convenient for the businessman, teacher, stu- dent, housewife or other Pocket Computer user to retain a number of favorite programs in the machine at the same time. This is especially easy to use in the Def mode. For example, suppose you are a school teacher with a small mail-order business on the side. You keep Grade 7 Scorer, Profit Estimator, Metric Converter and Whodunit? all loaded into your Pocket Computer at the same time. Grade Scorer is handy for summarizing student test results. Profit Estimator is useful when you want to know roughly how much you can expect to make from your next mail-order ad campaign. Metric Converter helps your students and helps you around the house. And Whodunit? beats jogging for lunchtime fun. From the listings in this book, you can see that Grade Scorer has a ‘‘G”’ in its first line. Profit Estimator starts with a ‘“B”. Metric Converter, an “=” and Whodunit? an “M”’. To use any of these in any order you want, select the Def mode and key in SHIFT G or SHIFT B or SHIFT = or SHIFT M. Depending upon whether or not you keyed in G, B, = or M, the program you wanted will start. The Def mode is especially convenient and time-saving. Table 1 shows how we reproduce the alphanumeric and special symbols used on the Pocket Computer. Table 1: Symbols In This Book DOLLAR SIGN : COLON ASTERISK + SEMICOLON () PARENTHESES , COMMA + PLUS SIGN . PERIOD = EQUALS 2? QUESTION MARK - MINUS SIGN / SLASH BAR 0 ZERO WT pr @ ZERO > GREATER THAN O LETTER O < LESS THAN ! EXCLAMATION POINT A EXPONENT CARET " QUOTATION MARK ¥ YEN (SHIFT Y) # NUMBER SYMBOL % PERCENT SYMBOL Profit Estimator How much profit will | generate if | spend this amount on advertising? A question frequently confront- ing the business person. Whether you sell large lots at wholesale or individual items via mail order, this program gives you a fast estimate of potential profits to be real- ized from various levels of advertising-dollar expen- ditures. It allows fast comparisons when quick decisions are needed. Manufacturing and advertising costs are included. Labor and overhead are not. For large-lot wholesale movement of goods, it gives you the information you need to compare quantity sold vs. discounts allowed. In advertising response, it allows comparison of ad costs vs. sales. It also calculates an approximate break- even point when you tell it that the profit you want is $1. To judge mail-order response, it permits com- parisons of mailing costs vs. size of mailings vs. rate of returns on orders. A useful tool for small business, whether a local furniture store or a national mail-order house. Program Listing 10 20 30 40 50 60 70 80 85 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 320 330 340 350 360 370 10 "B" CLEAR INPUT" W OR D OR M ?",Q$ INPUT"MFG COST = $";C INPUT"QUANTITY MFGD = ";P INPUT"LIST PRICE = §":L INPUT"TOTAL SOLD = ":§ IF Qs="D" THEN "x" IF Qs="M" THEN wee IF S=$ THEN 30 INPUT"WHLSL DISCOUNT % = ";D W=LS*((100-D)/100) G=LS* ( (100-D)/100)-cP PRINT"WHLSL INVOICE = $";W PRINT"WHLSL PROFIT = $";G GOTO 60 "#" INPUT"AD COST/INSERT S"sA INPUT"TOTAL INSERTIONS = ";I IF S THEN "7" INPUT"PROFIT WANTED = $";F IF F=$ THEN 30 B=(F+AI+PC)/L:B=INT B+l PRINT"SELL ";B;" PROFIT $";F GOTO 180 "q" N=SL:N=INT N E=SL-PC-AI:E=INT E PRINT"GROSS ORDERS = $":N PRINT" DRCT ML PROFIT = §"-E GOTO 60 "¥" TNPUT"FLYERS MAILED = ";K INPUT"FLYER PRINT COST = §":R INPUT"POSTAGE COST = $";M J=INT (100*S/K) T=LS-(R+M+PC):T=INT T U=LS PRINT" D-MAIL RETURN % = "-J PRINT" D-MAIL GROSS = §"-y PRINT" D-MAIL PROFIT = §"-7 GOTO 60 Sample Run ADVERTISING ORDER RESPONSE DEF MODE SHIFT B W OR D OR M? M ENTER MFG COST = §$ -89 ENTER QUANTITY MFGD = 1000 ENTER LIST PRICE 5.95 ENTER u Boe TOTAL SOLD 300 ENTER AD COST/INSERT = §$ 330 ENTER TOTAL INSERTIONS = 3 ENTER GROSS ORDERS = $1785 DRCT ML PROFIT = $-95 TOTAL SOLD = 500 ENTER AD COST/INSERT ENTER i] UW TOTAL INSERTIONS = ENTER GROSS ORDERS = $2975 DRCT ML PROFIT = $1095 TOTAL SOLD = @ ENTER 11 AD COST/INSERT = §$ 330 ENTER TOTAL INSERTIONS = 3 ENTER PROFIT WANTED = § 1 ENTER SELL 317. PROFIT $1 PROFIT WANTED = $ 1000 ENTER SELL 485. PROFIT $1000 Sample Run WHOLESALE PROFIT ESTIMATOR DEF MODE 12 SHIFT B W OR D OR M? W ENTER MFG COST = $ -89 ENTER QUANTITY MFGD = 1000 ENTER LIST PRICE = $ 5.95 ENTER TOTAL SOLD = 300 ENTER WHLSL DISCOUNT % = 40 ENTER WHLSL INVOICE = $1071 WHLSL PROFIT = $181 TOTAL SOLD = 500 ENTER WHLSL DISCOUNT % = 50 ENTER WHLSL INVOICE = $1487.50 WLSL PROFIT = $597.50 TOTAL SOLD «* @ ENTER MFG COST = §$ Sample Run DIRECT MAIL RESPONSE DEF MODE SHIFT B W OR D OR M? D ENTER MFG COST = $ 89 QUANTITY MFGD = 1000 ENTER LIST PRICE 5.95 ENTER u Ww i] TOTAL SOLD 50 ENTER FLYERS MAILED = 200 ENTER FLYER PRINT COST = $ 15 ENTER POSTAGE COST = §$ -15*200 ENTER 13 Hourly Wages, With Overtime Payroll bookkeeping is quick and simple with this hourly wage finder. The program knows that overtime D-MAIL RETURN % =25 D-MAIL GROSS = $297.50 D-MAIL PROFIT = $-638 ENTER TOTAL SOLD = 500 ENTER FLYERS MAILED = 5000 ENTER FLYER PRINT COST = $ 75 ENTER POSTAGE COST = $ .15*5000 ENTER D-MAIL RETURN % = 10 D-MAIL GROSS = $2975 D-MAIL PROFIT = $1260 starts after 40 hours and calculates accordingly. paycheck before tax and other deductions. Program Listing 10 20 30 40 50 14 CLEAR To modify this program, you’ll want to know that P is the employee’s hourly wage rate; X is overtime pay at time-and-a-half; W is total hours worked; R is regular non- overtime hours worked; Q is overtime hours worked (in other words, Q=W-40);and C is the gross amount of the BEEP 1: INPUT"HOURLY PAY = $";P BEEP 1:INPUT"HOURS WORKED = IF W)40 LET Q=W-40:R=40:GOTO 60 R=W:Q=0 "ey 60 X=1.5P:C=PR+XQ 70 BEEP 2:PRINT"GROSS PAY = $";C 80 GOTO 10 Sample Run DEF MODE SHIFT H BEEP HOURLY PAY = $ 3.35 ENTER BEEP HOURS WORKED = 53 ENTER BEEP BEEP GROSS PAY = $199.325 Pocket Datebook Imagine your Pocket Computer is a 20-page notebook. Each page has space for seven letters or numbers. It makes a convenient file for data you will need to recall or calendar for dates you need to remember: birthdays, anni- versaries, meetings. The program includes “error trapping” which means it won’t accept a command to read from a page number larger than 20. Nor will it write, in its present configura- tion, beyond page 20. The program searches for an empty page to write on. If none is available, it displays a table of contents and asks which page you would like to replace with new data. Remember to abbreviate your data down to combinations of seven letters and numbers. Program Listing 10 " Dp" 20 PAUSE" DO YOU WANT TO..." 30 PAUSE" WRITE IN..." 40 PAUSE" OR READ" 50 PAUSE" THE POCKET DATEBOOK ?" 60 BEEP 1 :INPUT"WRITE OR READ (W OR R)?",US 15 70 IF US="W" THEN "Ww" 80 IF US="R" THEN "R" 90 GOTO 60 100 "WwW" v=6 110 V=V+1 120 IF V>20 THEN 150 130 IF A$(V) PAUSE" SEARCHING FOR EMPTY PAGE" :GOTO 110 140 GOTO 180 . 150 PAUSE"ALL 20 PAGES FULL":GOSUB 220 160 PAUSE"WHICH TO REPLACE ?" 170 BEEP 1:INPUT"WHICH PAGE (1 TO 20) ?",V 175 IF V>20 THEN 170 180 BEEP 1:INPUT"WRITE NEW INFO",AS$(V) 190 BEEP 1:INPUT"WANT TO WRITE MORE ?",XS$ 200 IF X$="YES" THEN "WwW" 210 GOTO 60 220 PAUSE"TABLE OF CONTENTS" 230 FOR V=1 TO 20 240 ZS=" " 250 PAUSE V;Z$:AS$(V) 260 NEXT V 270 RETURN 300 mR 310 PAUSE"TABLE OF CONTENTS" 320 FOR V=1 TO 20 330 IF AS(V) THEN 350 340 GOTO 370 350 ZS=""_":PAUSE V;ZS$;AS(V) 360 NEXT V 370 PAUSE"WHICH PAGE TO SEE ?" 380 BEEP 1:INPUT"PAGE (1 TO 20) = ":W 390 IF W>20 THEN 380 400 PRINT AS$(W) 410 BEEP 1 :INPUT"WANT TO READ MORE ?",XS$ 420 IF X$="YES" THEN 380 430 GOTO 60 Sample Run DEF MODE SHIFT D 16 BEEP BEEP BEEP BEEP BEEP BEEP BEEP DO YOU WANT TO... WRITE IN... OR READ THE POCKET DATEBOOK ? WRITE OR READ (W OR R)? W ENTER WRITE NEW INFO BJ10/21 ENTER WANT TO WRITE MORE? YES ENTER SEARCH FOR EMPTY PAGE WRITE NEW INFO ES 3/21 ENTER WANT TO WRITE MORE? NO ENTER WRITE OR READ (W OR R)? R ENTER TABLE OF CONTENTS 1. BJ10/21 2. ES 3/21 WHICH PAGE TO SEE? PAGE(1 TO 20)= 2 ENTER ES 3/21 ENTER WANT TO READ MORE? NO ENTER 17 Advertising Cost-per-Thousand Suppose your local radio station time salesman told you he could deliver 51,000 listeners for each $133 ad run on his station. And your local newspaper space salesman said he could deliver 160,000 readers for each $330 ad run in his paper. Which would be the better quantity buy for you? This program gives you the answers in black and white. The newspaper would cost you about $2.06 for each 1000 readers while the radio station would cost almost $2.61 per thousand listeners. Now all you need to decide is which audience you prefer. By the way, the cost-per-thousand comparison ap- plies to magazines, TV, or any medium. Program Listing 10 "C" CLEAR 20 INPUT"AD COST = S$":A 30 INPUT"CIRCULATION = ";C 40 M=1000*(A/C) 50 PRINT" $";M;" COST/THOUSAND" 60 GOTO 10 Sample Run DEF MODE SHIFT C AD COST = $ 330 ENTER CIRCULATION = 160000 ENTER $2.0625 COST/THOUSAND ENTER AD COST = $ 133 ENTER CIRCULATION = 51000 ENTER $2.607843137 COST/THOUSAND 18 Advertising Cost-per-Unit Sold Your favorite newspaper had the lowest cost-per- thousand so you ran an ad. The ad cost you $330. Lots of customers came by to check out your merchandise and you actually sold 77 pieces. What’d it cost you to sell each item? With this quickie program you’ll know it cost you $4.28 in ad money to sell each unit. Program Listing 10 "A" CLEAR 20 INPUT"AD COST = S$";A 30 INPUT "UNITS SOLD = ";U 40 C=A/U 50 PRINT"AD COST $";C;" PER UNIT" 60 GOTO 10 Sample Run DEF MODE SHIFT A AD COST = $ 330 ENTER UNITS SOLD = 77 ENTER AD COST $4.28 PER UNIT Unit Cost You know you’ve just printed 200 newsletters. Your costs came to $11.50. But how much did it cost you per each item among the 200? The answer from this program: 5.75¢. The first program here compares the quantity of items you manufacture with the total cost of manufactur- ing those items and gives you the unit cost per item, in dollars. 19 Program Listing 10 "K" CLEAR 20 INPUT"QUANTITY MFGD = ";M 30 INPUT"TOTAL MFG COST = $";5C 40 T=C/M 50 PRINT"EACH COST $";T 60 GOTO 10 The second program is a modification of the first, permitting display of low-unit-cost items in cents rather than in dollars. The example is in printing where unit costs often are in cents. Program Listing 10 "K" CLEAR 20 INPUT"QUANTITY PRINTED = ":P 30 INPUT"TOTAL PRINT COST = $":C 40 T=C/P 50 IF Tél LET T=100T:GOTO 80 60 PRINT"EACH COST $";T 70 GOTO 10 80 PRINT USING" ###.##";"EACH COST " -T:" CENTS" 90 GOTO 10 Sample Run DEF MODE SHIFT K QUANTITY PRINTED 500 ENTER TOTAL PRINT COST $ 35 ENTER EACH COST 7.00 CENTS ENTER QUANTITY PRINTED 200 ENTER TOTAL PRINT COST $ 11.50 ENTER EACH COST 5.75 CENTS i] 20 Mark-Up: Standard Percentage In pricing goods for retail sale in your store, you like to take a standard 40 percent mark-up, rounded up to the nearest 95¢ . This program does that work for you. Program Listing 10 "J" CLEAR 20 BEEP 1:INPUT"WHOLESALE PRICE = $":W 30 BEEP 1:INPUT"MARK-UP % = ";M 40 P=INT (W/(1-.01M))+.95 50 BEEP 2:PRINT"RETAIL PRICE = $";P 60 GOTO 10 Sample Run DEF MODE SHIFT J BEEP WHOLESALE PRICE = $ 3.67 ENTER BEEP MARK-UP % = 40 ENTER BEEP BEEP RETAIL PRICE = $6.95 Mark-Up: Manufacturing to Retail Your manufacturing firm, selling products directly to the public, calculates retail price by using a standard multiplier times manufacturing cost. You use such a standard because exact manufacturing/production costs are too complex to calculate exactly for every product. Suppose your firm uses 10x as the multiplier. That is, it multiplies manufacturing cost by ten to set retail price. 21 If one product has a manufacturing cost of 86¢, the for- mula would indicate a retail price of $8.60. Many firms round the intermediate price ($8.60 in this example) up to the next 95¢. You decide to do just that. Thus, the item which cost 86¢ to manufacture will carry a retail price of $8.95. This program, which multiplies and rounds up to 95¢, is equally useful in calculating wholesale or retail prices. Program Listing 10 "H" CLEAR 20 BEEP 1:INPUT"MFG COST = $"5C 30 BEEP 1:INPUT"PRICING MULTIPLIER = ";M 40 P=INT(CM)+.95 50 BEEP 2:PRINT"RETAIL PRICE = $";P 60 GOTO 10 Sample Run DEF MODE SHIFT H BEEP MFG COST = $ 1.12 ENTER BEEP PRICING MULTIPLIER = 10 ENTER BEEP BEEP RETAIL PRICE =$11.95 ENTER BEEP MFG COST = $ .79 ENTER BEEP PRICING MULTIPLIER = 8 ENTER BEEPBEEP RETAIL PRICE =$6.95 22 Mark-Up: Wholesale to Retail You know the discount your supplier gives you. You have his invoice showing the wholesale price you paid him. This program combines the wholesale discount you received with the wholesale price you paid to recreate the retail price, or ‘list’ price. Program Listing 10 "G" CLEAR 20 BEEP 1:INPUT"WHOLESALE DISCOUNT % = ";D 30 BEEP 1:INPUT"WHOLESALE PRICE = $";W 40 D=.01D:P=W/(1-D) 50 BEEP 2:PRINT"RETAIL PRICE = $";P 60 GOTO 10 Sample Run DEF MODE SHIFT G BEEP WHOLESALE DISCOUNT %= 40 ENTER BEEP WHOLESALE PRICE = $ 3.57 ENTER BEEP BEEP RETAIL PRICE = $5.95 Making Change A penny saved is a penny earned. Every businessman is aware of pennies, nickels, dimes, even quarters lost by sales people who can’t make correct change. If you have sales people out front accepting cash away from your register, or if you’re too small to have a cash register, use this program to make correct change. 23 Key in the amount of the sale and the amount of money tendered by the customer and this software will tell you exactly how many quarters, dimes, nickels and pennies to hand back to the customer. Program Listing 10 "C" CLEAR 20 BEEP 1:INPUT"SALE AMOUNT CENTS = ";X 30 BEEP 1:INPUT"CENTS TENDERED = ";T 40 A=T-X 50 IF A<25 THEN 80 60 Q=Q+1:A=A-25 70 GOTO 50 80 IF A¢10 THEN 120 90 D=D+1:A=A-10 100 GOTO 80 120 IF A¢5 THEN 150 130 N=N+1:A=A-5 140 GOTO 120 150 P=A 200 BEEP 2 :PRINT USING "##HE";Q;" Q. ";D:" D. " Ne" Ne"sPs" pom 210 GOTO 10 Sample Run DEF MODE SHIFT C BEEP SALE AMOUNT CENTS = 51 ENTER BEEP CENTS TENDERED = 75 ENTER BEEP BEEP GQ. 2D. ON. 4P. ENTER 24 BEEP SALE AMOUNT CENTS = 6 ENTER BEEP CENTS TENDERED = 100 ENTER BEEP BEEP 3Q. 1D. 1N. 4P. Invoice Totaling There’s a lot of repetitious math work to be done before you mail invoices to your customers. This software has the computer collect a few pertinent bits of data from you and then spits out the various totals you need to plug into your invoice. It will give you total retail price for all goods sold on the invoice, total sales tax, total shipping charges and, finally, the total amount due you from your customer. Program line 40 directs the computer to ask you for the sales tax percentage rate in your state. Key in that sales tax rate if you wish to collect the tax with this in- voice. If you don’t need to collect sales tax, key in a zero when the computer asks for the percentage. Line 50 asks for shipping charges. When running the program, these can be keyed in as a total amount, or asa multiplication of units-times-cost. For instance, you might key in your answer as .21*20 or you might key it in simply as 4.2. Program Listing 10 "M" CLEAR 20 BEEP 1:INPUT"QUANTITY SOLD = ";Q 30 BEEP 1:INPUT"UNIT PRICE = $";P 40 BEEP 1:INPUT"SALES TAX % =";S 50 BEEP 1:INPUT"SHIPPING = $";H 60 S=.01S:C=QP:T=CS: F=C+T+H 70 BEEP 2:PRINT"TOTAL PRICE = $";C 25 80 BEEP 2:PRINT"SALES TAX = $";T 90 BEEP 2:PRINT"SHIPPING = $";H 100 BEEP 2:PRINT" INVOICE TOTAL = $";F 110 GOTO 10 Sample Run DEF MODE SHIFT M BEEP QUANTITY SOLD = 20 ENTER BEEP UNIT PRICE $= 5.95 ENTER BEEP SALES TAX % = 5 ENTER BEEP SHIPPING = $ -21*20 ENTER BEEPBEEP TOTAL PRICE = $119 BEEPBEEP SALES TAX = $5.95 BEEPBEEP SHIPPING = $4.20 BEEP BEEP INVOICE TOTAL = $129.15 Salesman’s Commissions Here’s the no-sweat way to compute commissions to be paid to your salesmen or reps, all of whom are at the same percentage rate. If you want to change the percentage in mid stream, as you are running this program, key in SHIFT S rather than ENTER after your last calculation. Program Listing 10 "S" CLEAR 20 BEEP 1 : INPUT"COMMISSION RATE % = ";R 26 30 R=.01R 40 BEEP 1 ?INPUT"COMMISSION SALES = $";S 50 C=RS 60 BEEP 2:PRINT"COMMISSION = $";C 70 GOTO 40 Sample Run DEF MODE SHIFT S BEEP COMMISSION RATE % = 8 ENTER BEEP COMMISSION SALES = $ 2751.85 ENTER BEEP COMMISSION = $220.148 ENTER BEEP COMMISSION SALES = $ 946.30 ENTER BEEPBEEP COMMISSION = $75.704 SHIFT S BEEP COMMISSION RATE % = 15 ENTER BEEP COMMISSION SALES = §$ 1126.50 ENTER BEEPBEEP COMMISSION = $168.975 ENTER BEEP COMMISSION SALES = §$ 3108 ENTER BEEPBEEP COMMISSION = $466.20 Rounding Cents to Nearest Penny This program is especially useful when used in con- junction with others which generate dollars-and-cents answers to more than two decimal places. Such as $151.6972. 27 It would make a good subroutine in a larger program. To use it as a subroutine, insert a GOSUB statement at the appropriate place in your set of instructions. Modify the line numbers so the subroutine will be located in an unused position in your listing. Change the last line of the subroutine (GOTO 10) to a RETURN statement. Delete the first line (‘‘M” CLEAR). Program Listing 10 "M" CLEAR 20 BEEP 1:INPUT"ORIG. AMOUNT = $":N 30 R=INT(100N+.5)/100 40 BEEP 2:PRINT "S":R 50 GOTO 10 Sample Run DEF MODE SHIFT M BEEP ORIG. AMOUNT = $ 151.6972 ENTER BEEP BEEP $151.70 YES/NO Executive Decision Maker Stumped by a toughie? Got one too hot to handle alone? Need help with major decisions? When there is no other way to decide, punch up this executive decision maker and get the answer: YES or NO. In 200 sample runs we produced 107 YES and 93 NO answers. Program Listing 10 "B" N=N+1:A=NN: Y=(997*X+A)/199 :X=Y-INT Y:X=X*E2 20 IF X>50 PRINT" YES":GOTO"B" 30 IF X<51 PRINT" NO":GOTO"B" 28 Adding A Column Of Numbers Using One-Key Entry The object is to minimize the number of keystrokes. Key in as many numbers as you like, in any order. When you have completed your list of numbers, type in a zero. The computer will add all of the numbers and display the total. Program Listing 700 "J" CLEAR 710 INPUT A 720 B=BtA 730 IF AS? THEN 710 740 PRINT B 750 GOTO 700 Sample Run 26 49 18 07 34 55 0 189 29 Grade Scoring Ideal for a teacher with lots of tests to evaluate, this program permits keying in up to 999 different scores in any order. To conclude entering a list of scores, the letter “‘X”’ is entered after the last score. The program then will display the total of all scores entered; range of scores; quantity of scores in each grade range; mean (average) score; and median score. Test scores must be in the range of zero to 100 for use by the program as it is written. The range could be modified. The computer assigns the letter grade of A for scores ranging from 90-100; B from 80-89; C from 70-79; D from 60-69; and F to scores below 60. A great time saver! Program Listing 10 "G" CLEAR 20 PAUSE"ENTER SCORES" 30 x=999 40 FOR E=l TO 999 50 INPUT"SCORE = ":G 60 IF G=X THEN 180 70 N=N+1 80 IF G<60 LET F=F+1:GOTO 130 90 IF G¢70 LET D=D+1:GOTO 130 30 100 IF G¢<80 LET C=C+1:GOTO 130 110 IF G<90 LET B=B+1:GOTO 130 120 A=A+1 130 IF N=] LET L=G:H=G 140 IF G«L LET L=G 150 IF G)H LET H=G 160 S=S+G 170 NEXT E 180 P=S/N:M=L+ ( (H-L)/2) 190 PRINT"SCORES RANGE ";L;" TO ";H 200 PRINT"MEDIAN SCORE =";M 210 PRINT"AVERAGE (MEAN) =";P 220 PAUSE"TOTALS OF EACH GRADE" 230 PRINT A;" A" 240 PRINT B;" B" 250 PRINT C;" c" 260 PRINT D;" Dp" 270 PRINT F;" F" 280 PRINT"TOTAL ";N;" SCORES" 290 GOTO 10 Sample Run DEF MODE SHIFT G ENTER SCORES SCORE = 87 ENTER SCORE = 55 ENTER SCORE = 91 ENTER SCORE = 82 ENTER SCORE= 79 ENTER SCORE = 75 ENTER SCORE = 63 ENTER SCORE = X ENTER SCORES RANGE 55 TO 91 MEDIAN SCORE =73 AVERAGE (MEAN) =76 TOTALS OF EACH GRADE 1A 2 2 1 1 T F OTAL 7 SCORES Slope and Distance This program computes the slope of a line between two points on a graph and the distance between those two points. The letter X designates the horizontal posi- tion on the graph and Y the vertical position. Program Listing 10 "S" CLEAR 20 BEEP 1:INPUT"X1l= "<A 30 BEEP 1:INPUT"Y1l= ";B 40 BEEP 1:INPUT"X2= ";C 32 50 BEEP 1: INPUT"Y2= ";D 60 IF A=C THEN 80 70 S=(D-B)/(C-A) 80 E=(ABS (C-A)A2 + ABS (D-B)A2)A.5 90 BEEP 2:PRINT"SLOPE = ";S 100 BEEP 2:PRINT"DISTANCE = ";E 110 GOTO 10 Sample Run DEF MODE SHIFT S BEEP Xl= 5 ENTER BEEP Yl= 8 ENTER BEEP X2= 11 ENTER BEEP Y2= 14 ENTER BEEPBEEP SLOPE=1 ENTER BEEP BEEP DISTANCE = 8.485281374 ENTER BEEP Xl= 14 ENTER BEEP Y1l= 26 ENTER BEEP X2= 5 ENTER BEEP Y2= 40 ENTER BEEPBEEP SLOPE = -1.555555556 ENTER BEEPBEEP DISTANCE = 16.64331698 dB Here’s a handy quickie for engineers, radio techni- cians, electronics buffs, hams, shortwave listeners and others who know how many bels there are in a decibel. Program Listing 10 "DB" CLEAR 20 BEEP 1:INPUT"INPUT POWER = ";I 30 BEEP 1:INPUT"OUTPUT POWER = ":0O 40 D=10*LOG(O+T) 50 BEEP 2:PRINT D;" DB" 60 GOTO 10 Sample Run RUN MODE RUN" DB" ENTER BEEP INPUT POWER = 100 ENTER BEEP OUTPUT POWER= 200 ENTER BEEPBEEP 3.010299957 DB 34 Flash Cards Math Drill Here’s a fun way to practice your math, or drill your kids on adding, subtracting, multiplying and dividing. The computer asks word questions which you answer YES or NO yesorno.Then it presents appropriate math problems for you to demonstrate your skills. Note: this is a long program to key in, leaving only 81 steps/10 memories when fully loaded. However, it is a pleasure to operate with its human-like conversation. Program Listing 10 "A" CLEAR 20 FOR X=1 TO 3:PAUSE" * FLASH CARDS *" :NEXT X 30 AS="ADD": BS="SUBTRACT" :C$="MULTIPLY" : DS=" DIVIDE" 40 PAUSE"":PAUSE" SHALL WE... 50 PAUSE" ADD":PAUSE" SUBTRACT" :PAUSE" MULTIPLY":PAUSE" DIVIDE" 60 BEEP 1:INPUT" WHICH ?",ES 70 IF ES=A$ THEN "ADD" 80 IF ES=BS$ THEN "SUBTRAC" 90 IF ES=CS$ THEN "MULTIPL" 100 IF ES=D$ THEN "DIVIDE" 110 GOTO 50 200 "ADD" PAUSE" OKAY" 210 FOR X=6 TO 7 220 S=((1+S)A5)-INT( (1H4S)A5) :S=10*S:R=INT S 222 IF R910 THEN 220 224 IF R¢€l THEN 220 230 A(X)=R 240 NEXT X 250 PAUSE USING "###";F:" 4+":G 260 BEEP 1;INPUT H 270 IF H=F+G PAUSE" CORRECT": J=J+1 :GOTO 285 280 PAUSE" WRONG":PAUSE" TRY AGAIN" :K=K+1:GOTO 250 35 285 290 295 300 310 320 322 324 330 340 350 360 370 380 385 390 395 400 410 420 422 424 430 440 450 460 470 480 485 490 495 500 510 520 36 BEEP 1:INPUT" MORE ?",L$ IF LS="YES" THEN "ADD" GOTO 600 "SUBTRAC" PAUSE" OKAY" FOR X=6 TO 7 S=( (+S )AS)-INT( (174+S)A5):S=10*S :R=INTS IF R)10 THEN 320 IF R¢l THEN 320 A(X)=R NEXT X PAUSE USING "###";F;" -";G BEEP 1:INPUT H IF H=F-G PAUSE" CORRECT" :J=J+1 :GOTO 385 PAUSE" WRONG":PAUSE" TRY AGAIN" :K=K+1:GOTO 350 BEEP 1:INPUT" MORE ?",L$ IF LS="YES" THEN "SUBTRAC" GOTO 600 "MULTIPL" PAUSE" OKAY" FOR X=6 TO 7 S=((%#S)A5)-INT( (W+S)A5) :S=10*S :R=INT S IF R>10 THEN 420 IF R41 THEN 420 A(X)=R NEXT X PAUSE USING "###";F;" X";G BEEP 1:INPUT H IF H=F*G PAUSE" CORRECT": J=J+1 :GOTO 485 PAUSE" WRONG":PAUSE" TRY AGAIN" :K=K+1:GOTO 450 BEEP 1:INPUT" MORE ?",L$ IF LS="YES" THEN "MULTIPL" GOTO 600 "DIVIDE" PAUSE" OKAY" FOR X= 6TO 7 S=((1f+S)A5)-INT( (11+S5)A5) :S=10*S :R=INT S 522 524 530 540 545 550 560 570 580 585 590 600 IF R910 THEN 520 IF R¢l THEN 520 A(X)=R NEXT X Q=FG PAUSE USING "##HE";Q;" /":G BEEP 1: INPUT H IF H=Q/G PAUSE" CORRECT": J=J+1 :GOTO 585 PAUSE" WRONG":PAUSE" TRY AGAIN" :K=K+1: GOTO 550 BEEP 1:INPUT" MORE ?",LS$ IF LS$="YES" THEN "DIVIDE" PAUSE"":BEEP 1 : INPUT" TRY SOMETHING ELSE ?",I$ 610 IF IS="YES" THEN 50 620 PAUSE" OKAY":PAUSE" YOUR SCORE... 630 PRINT J;" CORRECT ";K;" WRONG" 640 GOTO 10 Sample Run DEF MODE SHIFT A * FLASH CARDS * * FLASH CARDS * * FLASH CARDS * SHALL WE... ADD SUBTRACT MULTIPLY DIVIDE BEEP WHICH? BEEP DIVIDE ENTER OKAY 12/2 ? 6 ENTER 37 BEEP BEEP BEEP BEEP BEEP BEEP BEEP BEEP 38 CORRECT MORE? YES ENTER OKAY 9/9 ? 1 ENTER CORRECT MORE? NO ENTER TRY SOMETHING ELSE? YES ENTER ADD SUBTRACT MULTIPLY DIVIDE WHICH? MULTIPLY ENTER OKAY 3 x7 2 14 ENTER WRONG TRY AGAIN 3 x 7 3 21 ENTER CORRECT MORE? NO ENTER BEEP TRY SOMETHING ELSE? NO ENTER OKAY YOUR SCORE... 3 CORRECT 1 WRONG MEMORY REMAINING: 81 STEPS 10 MEMORIES Smart Computer This game is so quick you can work it in while your secretary is away sharpening her pencil. It’s more or less the reverse of the old favorite High-Low Number bit. In this rendition, you come up with the secret three-digit number and the computer guesses it! In old-fashioned High-Low, the computer could keep you guessing for hours. Here, the computer asks one lit- tle old question and...bingo! It has the correct answer in an instant. By the way, this program can make you look like the company genius at the next office party. Ask your friends to pick a secret number and ask them the one question the computer asks you. You’ll get the right answer from your Pocket Computer in a flash. The mystery number has to be a three-digit number with all digits the same. Program Listing 10 "X" CLEAR 20 PAUSE"PICK A 3-DIGIT NUMBER" 30 PAUSE"WITH ALL DIGITS SAME" 40 PAUSE"ADD THE 3 DIGITS" 50 BEEP 1 :INPUT"SUM OF THE 3 DIGITS ?",N 60 Q=37N 70 PRINT"YOUR NUMBER IS ";Q 80 GOTO 10 39 Sample Run DEF MODE SHIFT X PICK A 3-DIGIT NUMBER WITH ALL DIGITS SAME ADD THE 3 DIGITS BEEP SUM OF THE 3 DIGITS ? 24 ENTER YOUR NUMBER IS 888 Frequency and Wavelength Engineering student. Radio technician. Ham operator, CBer, or shortwave listener. You hate to dig out a pencil and paper just to convert frequency to wavelength. Or wavelength to frequency. This program does it in an instant. Follow it up with our Metric Converter program and you’ll even know how many “inches” of wavelength in your favorite frequency. Program Listing 10 "F" CLEAR 20 PAUSE"FREQ OR WAVELENGTH" 30 INPUT"WANT F OR W ?",AS 40 IF AS="F" THEN 90 50 INPUT"FREQUENCY (MHZ) = ";F 60 W=300/F 70 PRINT F:" MHZ = ":W:" METERS" 80 GOTO 10 90 INPUT"WAVELENGTH (METERS) = ";W 100 F=300/W 110 PRINT W;" METERS = ";F;" MHZ" 120 GOTO 10 40 Sample Run DEF MODE SHIFT F FREQ OR WAVELENGTH WANT F OR W? W ENTER FREQUENCY (MHZ) = 7.5 ENTER 7.5MHZ = 40 METERS FREQ OR WAVELENGTH WANT F OR W? F ENTER WAVELENGTH ( METERS) = 160 ENTER 160 METERS = 1.875 MHZ Metric Converter Keep this math conversion program loaded in your Pocket Computer and you’ll always have a handy way to quickly change feet, inches or yards into millimeters, cen- timeters or meters. Or vice versa. Program Listing 10 20 30 40 50 60 70 80 90 100 "=" CLEAR PAUSE"METRIC CONVERSION" INPUT"TO METRIC (Y OR N) ?",AS IF AS="N" THEN "METERS" INPUT"IN, FT OR YDS ?",B$ IF BS="IN" THEN "INCHES" IF BS="FT" THEN "FEET" IF BSe"YDS" THEN "YARDS" GOTO 30 “INCHES" INPUT"INCHES = ":I 41 110 M=I/39.37:C=100M:N=1000M 120 PRINT I; "IN = ";N;"MM" 130 PRINT I:"IN = ";C;"CM" 140 PRINT I;"IN = ";M;"MTRS" 150 GOTO 30 200 "FEET" INPUT"FEET = ";F 210 I=12F:M=I/39.37:C=100M:N=1000M 220 PRINT F;"FT = ";N;"MM" 230 PRINT F;"FT = ":C;"CM" 240 PRINT F;"FT = ":M;"MTRS" 250 GOTO 30 300 "YARDS" INPUT"YARDS = ";Y 310 I=36Y:M=1I/39.37:C=100M:N=1000M 320 PRINT Y;"YDS = ";N; "MM" 330 PRINT Y:"YDS = ";C: "CM" 340 PRINT Y;"YDS = ":M:"MTRS" 350 GOTO 30 400 "METERS" 410 INPUT"CM, MM OR MTRS ?",DS 420 IF D$="CM" THEN "CM" 430 IF D$="MM" THEN "MM" 440 IF D$="MTRS" THEN "MTRS" 450 GOTO 30 500 "CM" INPUT"CENTIMETERS = ";C 510 I=.3937C:F=I/12:Y=I/36 520 PRINT C;"CM = ";I;"IN" 530 PRINT C:"CM = ";F;"PTr" 540 PRINT C:"CM = ":Y;"YDS" 550 GOTO 30 600 "MM" INPUT"MILLIMETERS = ";N 610 I=.03937N:F=1/12:Y=I/36 620 PRINT N;"MM = ";I;"IN" 630 PRINT N;"MM = "sFe"Pr" 640 PRINT N;"MM = ";Y;"YDS" 650 GOTO 30 700 "MTRS" INPUT"METERS = ";M 710 I=39.37M:F=I/12:Y=1/36 720 PRINT M;"MTRS = ":I;"IN" 730 PRINT M;"MTRS = "<:F:"FT" 740 PRINT M;"MTRS = ":Y;"YDS" 750 GOTO 30 42 Sample Run DEF MODE SHIFT = METRIC CONVERSION TO METRIC (Y OR N)? N ENTER CM,MM OR MTRS? CM ENTER CENTIMETERS = 225 ENTER 225 CM=88.5825 IN ENTER 225CM = 7.381875 FT ENTER 225 CM = 2.460625 YDS ENTER TO METRIC (Y OR N)? Y ENTER IN, FT OR YDS? FT ENTER FEET = 49 ENTER 14935.22987 MM 49 FT ENTER 49 FT 1493.522987 CM ENTER i] 49 FT 14.93522987 MTRS Factors This program lists the factors of any number you specify up to 129. It could be used as a subroutine in a larger program. Program Listing 10 "M" CLEAR 20 BEEP 1:INPUT" NUMBER = ";A(130) 30 IF A(130)<3 GOTO 10 40 FOR A(131)=2 TO (A(130)/2) 50 PAUSE" CHECKING ";A(131) :A(132)=A(130)/A(131) 60 IF A(132)=INT A(132) LET A(133)=A(133)+1 :A(A(133) )=A(132) :PAUSE A(131);" IS A FACTOR" 70 NEXT A(131) 80 BEEP 2:PAUSE" RECAPPING..." 90 FOR A(134)=1 TO (A(130)/2) 100 IF A(A(134))>1 BEEP 1 :PAUSE A(A(134));" IS A FACTOR" 110 NEXT A(134) 120 GOTO 10 Sample Run DEF MODE SHIFT M BEEP NUMBER = 18 ENTER CHECKING 2 2 IS A FACTOR CHECKING 3 3 IS A FACTOR CHECKING 4 CHECKING 5 CHECKING 6 6 IS A FACTOR 44 CHECKING 7 CHECKING 8 CHECKING 9 9 IS A FACTOR BEEPBEEP RECAPPING... BEEP 9 IS A FACTOR BEEP 6 IS A FACTOR BEEP 3 IS A FACTOR BEEP 2 IS A FACTOR Ohm’s Law The basis of all electronics and electricity. E is volts. | is amps. R is ohms. If you know any two of the values, the computer will give you the third. Program Listing 10 20 30 40 50 200 210 220 230 300 310 320 330 400 410 420 430 "L" CLEAR PAUSE"ENTER KNOWN DATA" BEEP 1:INPUT"CURRENT (AMPS) = ";I BEEP 1: INPUT" RESISTANCE (OHMS)=";R BEEP 1:INPUT"VOLTAGE = ";E IF I THEN 300 I=E/R BEEP 2:PRINT"CURRENT "eT:" AMPS" GOTO 10 IF E THEN 400 E=IR BEEP 2:PRINT"VOLTS = ";E GOTO 10 IF R THEN 10 R=E/I BEEP 2:PRINT"RESISTANCE = ";R;" OHMS" GOTO 10 45 Sample Run DEF MODE BEEP BEEP BEEP BEEPBEEP BEEP BEEP BEEP BEEPBEEP 46 SHIFT L ENTER KNOWN DATA CURRENT (AMPS)= -500 ENTER RESISTANCE (OHMS)= ENTER VOLTAGE = 12 ENTER RESISTANCE = 24 OHMS ENTER ENTER KNOWN DATA CURRENT (AMPS)= ENTER RESISTANCE (OHMS)= 1000 ENTER VOLTAGE = 24.6 ENTER CURRENT =0.0246 AMPS Reciprocals Key in a number and the computer displays its reciprocal. Program Listing 10 "L" CLEAR 20 BEEP 1: INPUT" NUMBER TO CONVERT" ,N 30 R=1/N 40 BEEP 2:PRINT"RECIP = ";R 50 GOTO 20 Sample Run DEF MODE SHIFT L BEEP NUMBER TO CONVERT 5 ENTER BEEP BEEP RECIP = 0.2 ENTER BEEP NUMBER TO CONVERT 32 ENTER BEEP BEEP RECIP = 0.03125 Memory Tester Suppose | pick a number out of the air. Say, 5. You can remember that, right? Or 73. Or 841. But, just how big a number can you see briefly and remember? This pro- gram throws ever-increasingly-larger random numbers at you and asks you to remember them. And it keeps score. What’s your memory’s upper limit? 47 Program Listing 10 20 30 40 50 60 70 80 90 100 110 120 130 "N" CLEAR Z=1 BEEP 1: INPUT"ANY NUMBER = ";S A=SS : Y=(997*X+A)/199 :X=Y-INT Y:X=10X:S=INT X IF S=9 THEN 40 N=INT (SZ) PAUSE" REMEMBER ";N FOR L=1 TO 25:NEXT L IF W=3 PAUSE" FORGET IT !" :PAUSE" START OVER":GOTO 10 BEEP 1:INPUT"WHAT WAS THE NUMBER ?",S IF S<>»N PAUSE" WRONG !" :W=W+1:GOTO 90 PAUSE" RIGHT !":R=R+1:W=0:Z=11Z PAUSE USING"###";R;" RIGHT SO FAR" :USING: GOTO 40 Sample Run DEF MODE SHIFT N BEEP ANY NUMBER = 44 ENTER REMEMBER 7289 (20 SECOND PAUSE) WHAT WAS THE NUMBER ? 7280 ENTER WRONG ! BEEP WHAT WAS THE NUMBER ? 48 7289 ENTER RIGHT ! 1 RIGHT SO FAR Pythagorean Theorem The theorem lets you find the length of any side of a right triangle if you know the length of the other two sides. The two shorter sides of the triangle are labeled A and B. The longer side, the hypotenuse, is C. The length of C is always longer than A or B. Program Listing 10 "H" CLEAR 20 BEEP 1:INPUT"SIDE A LENGTH = ";A 30 BEEP 1:INPUT"SIDE B LENGTH = ";B 40 IF A THEN 60 50 GOTO 70 60 IF B THEN 150 70 BEEP 1:INPUT"HYPOTENUSE (C) = ";C 90 IF A THEN 120 100 A=V¥(CA2-BA2) 110 GOTO 170 120 IF B THEN 150 130 B=¥(CA2-AA2) 140 GOTO 190 150 C=¥(AA2+BA2) 160 GOTO 210 170 BEEP 2:PRINT"SIDE A = "A 180 GOTO 10 " 190 BEEP 2:PRINT"SIDE B = ";B 200 GOTO 10 210 BEEP 2:PRINT"HYPOTENUSE = ";C 220 GOTO 10 Sample Run DEF MODE SHIFT H BEEP SIDE A LENGTH = 16 ENTER BEEP SIDE B LENGTH = 12 ENTER 49 BEEPBEEP HYPOTENUSE = 20 ENTER BEEP SIDE A LENGTH = ENTER BEEP SIDE B LENGTH = 25.3 ENTER BEEP HYPOTENUSE (C) = 36.9 ENTER BEEPBEEP SIDE A = 26.86112432 Averages Now you can average a series of up to 150 numbers. Just key them in, in any order. After the last number in the series is keyed in, press ENTER or 9 ENTER to complete the computation. Obviously, zero can’t be one of the numbers in the series you are averaging. Program Listing 10 "X" CLEAR 20 FOR A=2 TO 151 30 BEEP 1:INPUT"NUMBER = "-A(A) 40 IF A(A)=6 THEN 70 50 A(153)=A(153)+A(A) 60 NEXT A 70 A=A-2 80 A(152)=A(153)/A 90 BEEP 2:PRINT"AVERAGE = ";A(152) 100 GOTO 10 Sample Run DEF MODE SHIFT X BEEP NUMBER = 1l ENTER 50 BEEP BEEP BEEP BEEP BEEP BEEP BEEP BEEP BEEP BEEP BEEPBEEP NUMBER = 22 ENTER NUMBER = 33 ENTER NUMBER = 44 ENTER NUMBER = 55 ENTER NUMBER = ENTER AVERAGE = 33 ENTER i] NUMBER 567 ENTER NUMBER 234 ENTER NUMBER = ENTER AVERAGE = 400.5 51 Temperature Conversion (F, C, K) F is Fahrenheit. C is Celsius. K is Kelvin. This pro- gram transforms temperature readings in one system to their equivalent values in the other two. For an easier-to-read, less precise temperature readout, make these changes to program lines 140, 240 and 340: 140 BEEP 2: PRINT INT F: DEGREES F” 240 BEEP 2: PRINT I