First fruits from the Practical Program Contest
By Hal Boyer
Here is our first published entry from the Antic 8-Bit Practical Program Contest-- which is still open until June 15. Wage/HourPaymaster is d short but useful program that keeps track of your hourly wage totals by week or by year. The BASIC program works on all 8-bit Atari computers of any memory size, with disk or cassette.
For the millions of wage-earners out there who are paid by the hour and put in overtime, Wage/Hour Paymaster calculates the weekly and yearly earnings from your total working hours. Short and simple as the program is, it has many convenient uses. For example, you could project how much cash that next over-time call will put into your pocket--and decide if the extra money is worth giving up your plans to attend the big ballgame.
To use Wage/Hour Paymaster, type in Listing 1, WAGES.BAS, check it with TYPO II and SAVE a copy before you RUN it.
When you RUN the program and see the first prompt, type in your hourly base pay. A pay rate of more than $20 or less than zero is not accepted. Type in your name at the next prompt and then choose whether to send the program's output to the screen or to a printer.
Wage/Hour Paymaster then creates a five-column table showing your base pay, overtime pay, weekly wages and yearly wages-in half-hour steps ranging from 40 to 65 hours per week.
Wage/Hour Paymaster is straightforward and well-remarked. The subroutines are near the beginning of the program to shorten access times. Each time a program tells your Atari to GOSUB a line, it searches for that line starting with the first line of your program. Placing often-used subroutines at the beginning of your program minimizes this search time.
The subroutine at lines 110-220 converts the program's output to dollars and cents format. Line 190 inserts the decimal point. If two trailing zeros are needed, the routine adds them at line 210. The resulting number is right-justified, so that the number column lines up on the decimal points.
Line 340 does a quick partial screen clear. The inverse up-arrow in the program is treated the same way as pressing [SHIFT] [DELETE]. This is one of the fastest and easiest ways to erase selected parts of your screen display.
Wage/Hour Paymaster is set up for Epson or Star(Gemini) printers. The printing routines automatically insert top and bottom margins, so you don't need to worry about printing your report on top of a page perforation Line 340 sends the printer a control code to print one line of expanded text. Line 370 calls for condensed print and line 650 lets you adjust the linefeed. If you own a printer that is not compatible with Epson or Star, check your printer manual for the substitute control codes, and insert them into these lines.
All calculation is performed in lines 760 to 830. If you wish to change your overtime pay rate from the straight time-and-a-half specified by the program, replace the 1.5 at line 800 with any other pay rate.
This short program can easily be modified to your own needs, if you know the essentials of BASIC programming. For example, a plumber--or other wage-earner who makes more than $20 an hour--can increase the program's maximum base pay rate. (Hint: Don't forget to change the 20 in line 490.)
If you are a part-time worker who normally puts in less than 40 hours weekly, or a workaholic who toils more than 65 hours a week, you might want to change the program's minimum md maximum hours (Hint: One modification is the HRS=39.5 in line 1110.)
Hal Boyer lives in Indianola, Mississippi. This is his first Publication in Antic.