--- title: "Net Pay" id: 57167 type: "computer_media" slug: "net-pay" url: "http://localhost/computer_media/net-pay/" markdown_url: "http://localhost/computer_media/net-pay.md" published_at: "2024-10-04T01:11:04+00:00" modified_at: "2026-03-30T21:19:16+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2024/10/116_NetP.png" excerpt: "Enter your desired take-home pay, tax rate, and deductions to instantly calculate the exact gross salary you need to earn." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" model: - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" genre: - name: "Finance" slug: "finance" taxonomy: "genre" url: "http://localhost/type/finance/" media_contents: - id: 56733 title: "Timex Sinclair Public Domain Library Tape 1002" type: "computer_media" url: "http://localhost/computer_media/timex-sinclair-public-domain-library-tape-1002/" media_type: "Program" mediadate: "198x" images: - url: "http://localhost/wp-content/uploads/2024/10/116_NetP.png" media_type_tags: "Finance" --- # Net Pay This program calculates the required gross pay needed to achieve a desired net pay after tax and other deductions. The user inputs the desired net pay, an effective tax rate (accepted as either a decimal or a percentage, with automatic conversion at line 45–50), and any additional fixed deductions. Line 80 performs the core calculation using the formula G = INT((N+D)/(1-T)+0.5), where rounding to the nearest whole dollar is achieved by adding 0.5 before truncating with INT. The program ends with STOP at line 100, leaving the calculated gross pay displayed on screen. *** ## Program Analysis ### Program Structure The program is short and linear, running from top to bottom in a single pass with no loops. It follows a simple input–calculate–output pattern across four logical phases: 1. Title display (lines 8–9) 2. User input collection (lines 10–71) 3. Gross pay calculation (line 80) 4. Result display and termination (lines 90–100) Lines 110 and 120 (`SAVE` and `LIST`) are utility lines appended after the `STOP` at line 100 and are never reached during normal execution. ### Input Echo Pattern Each `INPUT` statement (lines 20, 40, 70) is immediately followed by a `PRINT` of the same variable (lines 21, 41, 71). This echoes the entered value back to the screen, providing a simple confirmation that the correct value was received — a common idiom in early BASIC data-entry programs where the input prompt and entered value may scroll or be ambiguous. ### Tax Rate Normalisation Lines 45–50 handle the tax rate input flexibly. If the user enters a value of 1 or greater (e.g. `25` for 25%), line 50 divides it by 100 to convert it to a decimal fraction. If the value is already less than 1 (e.g. `0.25`), the branch at line 45 skips directly to line 60, leaving `T` unchanged. This allows both input conventions without requiring the user to know which format is expected. ### Core Calculation The gross pay formula at line 80 is: `LET G=INT((N+D)/(1.0-T)+.5)` This derives from the relationship: *Net = Gross × (1 − TaxRate) − Deductions*, rearranged to *Gross = (Net + Deductions) / (1 − TaxRate)*. Adding `0.5` before applying `INT` achieves conventional rounding to the nearest whole currency unit rather than truncation. The use of `1.0-T` rather than `1-T` is stylistic but has no functional difference. ### Notable Techniques and Observations - The dollar sign in the output string (`"REQUIRED GROSS PAY=$ "`) indicates the program was written for a North American audience. - No input validation is performed beyond the tax-rate normalisation; entering `T=1` (100% tax) would cause a division-by-zero error at line 80. - The `REM` at line 5 serves solely as a program title label; it has no effect on execution. - Line numbers 8 and 9 suggest the header display was added after the original line 10 was written, fitting content into the gap. ### Variable Summary | Variable | Meaning | | --- | --- | | `N` | Desired net (take-home) pay | | `T` | Effective tax rate (normalised to decimal) | | `D` | Other fixed deductions | | `G` | Calculated required gross pay | ## Source Code ``` 5 REM NETPAY 8 PRINT TAB (5);"NET PAY CALCULATION" 9 PRINT 10 PRINT "ENTER RQD NET PAY" 20 INPUT N 21 PRINT N 30 PRINT "EFFECTIVE TAX RATE" 40 INPUT T 41 PRINT T 45 IF T<1 THEN GOTO 60 50 LET T=T/100 60 PRINT "ENTER OTHER DEDUCTIONS" 70 INPUT D 71 PRINT D 80 LET G=INT ((N+D)/(1.0-T)+.5) 90 PRINT "REQUIRED GROSS PAY=$ ";G 100 STOP 110 SAVE "1011%6" 120 LIST ```