--- title: "Media Money" id: 56990 type: "computer_media" slug: "media-money-cost-of-ads" url: "http://localhost/computer_media/media-money-cost-of-ads/" markdown_url: "http://localhost/computer_media/media-money-cost-of-ads.md" published_at: "2024-10-02T01:21:04+00:00" modified_at: "2026-03-30T21:20:26+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2024/10/15_Ad.png" excerpt: "Enter ad cost and circulation for two media and instantly compare their Cost Per Mille to find the better advertising buy." 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: "Business" slug: "business" taxonomy: "genre" url: "http://localhost/type/business/" media_contents: - id: 56732 title: "Timex Sinclair Public Domain Library Tape 1001" type: "computer_media" url: "http://localhost/computer_media/timex-sinclair-public-domain-library-tape-1001/" media_type: "Program" mediadate: "198x" images: - url: "http://localhost/wp-content/uploads/2024/10/15_Ad.png" media_type_tags: "Business" --- # Media Money This program calculates and compares the Cost Per Mille (CPM) — the cost per 1,000 impressions — for two advertising media, such as newspapers or magazines. The user enters a name, ad cost, and circulation figure for each medium; the program divides cost by circulation and multiplies by 1,000 to produce the CPM for each. It then prints both CPM values and identifies which medium offers the lower cost, or reports no difference if they are equal. After displaying results, it waits for a keypress and loops back to accept new inputs. *** ## Program Analysis ### Program Structure The program is straightforward and linear, divided into three functional phases: 1. **First medium input (lines 10–100):** Prompts for name (`N$`), ad cost (`A`), and circulation (`C`); computes CPM as `M = 1000 * (A / C)`. 2. **Second medium input (lines 110–200):** Repeats the same process for variables `P$`, `Q`, `R`, and `S`. 3. **Results and loop (lines 210–350):** Displays both CPM values, compares them with three `IF` statements, waits for a keypress, clears the screen, and loops back to line 10. ### CPM Calculation The core formula at lines `100` and `200` is standard advertising mathematics: multiply the ratio of cost to circulation by 1,000 to give the cost per thousand readers or viewers. The parentheses around `A/C` are redundant but harmless, as division already has higher precedence than multiplication. ### Key Variables | Variable | Meaning | | --- | --- | | `N$` | Name of first medium | | `A` | Ad cost for first medium | | `C` | Circulation of first medium | | `M` | CPM for first medium | | `P$` | Name of second medium | | `Q` | Ad cost for second medium | | `R` | Circulation of second medium | | `S` | CPM for second medium | ### Notable Techniques - **Keypress wait loop:** Line `330` uses `IF INKEY$="" THEN GOTO 330`, a standard busy-wait idiom for pausing execution until any key is pressed. - **Three-way comparison:** Lines `250`–`270` use three separate `IF` statements testing `S>M`, `M>S`, and `M=S` to cover all cases. This is idiomatic for BASIC dialects lacking `ELSE` or `SELECT CASE`. - **Continuous loop:** The program never truly ends during normal use; line `350` sends execution back to line `10` after each comparison, allowing repeated use without restarting. ### Bugs and Anomalies - **Line 140 typo:**`POKE "AD COST: $ ";` should almost certainly be `PRINT "AD COST: $ ";`. As written, the `POKE` keyword expects two numeric arguments (an address and a value), so this line would produce a syntax or type error at runtime. This is evidently a transcription error in the listing. - **Unreachable lines 375–500:** Lines `375` (`CLEAR`), `400` (`SAVE "1001%5"`), and `500` (`RUN`) are never reached during normal execution because the loop at line `350` returns to line `10` indefinitely. These lines exist solely for the user to `GOTO` or execute manually — the `SAVE` at line `400` stores the program with an auto-run flag encoded in the filename. - **Division by zero risk:** If the user enters `0` for circulation, lines `100` or `200` will cause a division-by-zero error. No input validation is provided. ## Source Code ``` 5 REM MEDIA MONEY 6 REM CHOOSE LOWER COST ADS** 10 PRINT "FIRST MEDIUM: "; 20 INPUT N$ 30 PRINT N$ 40 PRINT "AD COST: $ "; 50 INPUT A 60 PRINT A 70 PRINT "CIRCULATION: "; 80 INPUT C 90 PRINT C 100 LET M=1000*(A/C) 110 PRINT "SECOND MEDIUM: "; 120 INPUT P$ 130 PRINT P$ 140 POKE "AD COST: $ "; 150 INPUT Q 160 PRINT Q 170 PRINT "CIRCULATION: "; 180 INPUT R 190 PRINT R 200 LET S=1000*(Q/R) 210 PRINT 220 PRINT 230 PRINT N$;" CPM: $ ";M 240 PRINT P$;" CPM: $ ";S 250 IF S>M THEN PRINT N$;" IS LOWER" 260 IF M>S THEN PRINT P$;" IS LOWER" 270 IF M=S THEN PRINT "NO DIFFERENCE" 300 PRINT 310 PRINT 320 PRINT "FOR MORE,PRESS ANY KEY" 330 IF INKEY$="" THEN GOTO 330 340 CLS 350 GOTO 10 375 CLEAR 400 SAVE "1001%5" 500 RUN ```