Life Expectancy

Date: 198x
Type: Program
Platform(s): TS 1000

Appears on

Assembled by Tim Ward from many sources. Contains programs 10051 – 10121.

Gallery

Life Expectancy

Source Code

   1 LET C=0
   2 PRINT "%L%I%V%E%S"
   3 LET A=71
   4 PRINT ,"AGE(YRS.)?"
   5 INPUT B
   6 GOSUB 54
   7 PRINT ,"MARRIED?"
   8 INPUT A$
   9 GOSUB 54
  10 IF A$="YES" THEN LET A=76
  11 PRINT "HAVE YOU BEEN FAIRLY  WELL OFF"
  12 PRINT "FINANCIALLY,MOST OF YOUR LIFE?"
  13 INPUT C$
  14 GOSUB 54
  15 IF C$="YES" THEN LET A=A-3
  16 PRINT "ARE YOU OVERWEIGHT?"
  17 INPUT D$
  18 GOSUB 54
  19 IF D$="NO" OR B<40 THEN GOTO 24
  20 IF D$="YES" THEN PRINT ,"BY HOW MANY POUNDS?"
  21 INPUT P
  22 LET C=C+P
  23 GOSUB 54
  24 PRINT "EXERCISE?-NEVER/SOMETIMES/OFTEN"
  25 INPUT E$
  26 GOSUB 54
  27 IF E$="SOMETIMES" THEN LET A=A+3
  28 IF E$="OFTEN" THEN LET A=A+5
  29 GOSUB 54
  30 PRINT "ARE YOU OFTEN TENSE?"
  31 INPUT F$
  32 GOSUB 54
  33 IF F$="YES" THEN LET A=A-3
  34 IF F$="NO" THEN LET A=A+3
  35 PRINT "DRINK? LITTLE=0/MODERATE=5"
  36 PRINT ,"HEAVY=10)"
  37 INPUT G
  38 IF B>A THEN LET A=B+(B-A)/2
  39 GOSUB 54
  40 PRINT "DO YOU SMOKE?"
  41 INPUT H$
  42 IF H$="YES" THEN LET A=A-5
  43 GOSUB 54
  44 PRINT "OFTEN ILL?"
  45 INPUT K$
  46 IF K$="YES" THEN LET A=A-3
  47 IF K$="NO" THEN LET A=A+3
  48 GOSUB 54
  49 PRINT "EST. AGE AT DEATH:"
  50 PRINT 
  51 PRINT ,"FEMALE-- ";A+7-C/5-G
  52 PRINT ,"MALE---- ";A-C/5-G
  53 STOP 
  54 CLS 
  55 PRINT 
  56 PRINT 
  57 PRINT 
  58 RETURN 
  60 SAVE "1005%2"
  65 RUN 

People

No people associated with this content.

Scroll to Top