C
C
C	THIS IS THE SUBROUTINE THAT IS CALLED UP TO ENTER NEW
C	MEMBERS INTO THE FEDERATION. IT INVOLVES TAKING A
C	MATH TEST IN A CERTAIN AMOUNT OF TIME.
C	
C	UPON COMPLETION OF THE TEST IT WILL ENTER YOU TO THE STARFLEET
C	OR IF YOU FLUNKED GIVE YOU AN APPROPRIATTE MESSAGE
C
C
	SUBROUTINE ENTER
	DIMENSION IA(68),IPS(16)
	CHARACTER*80	WHERE
	CHARACTER*20	TME,DTE
	LOGICAL*1	IPS,IA
	CHARACTER*10	SHPSNM,SHP
	CHARACTER*8	RANK,USR1,PASS1,PASS,USR,USR3
	EQUIVALENCE (IA(1),RANK),(IA(6),USR),(IA(14),SHPSNM),
     1		(IA(24),IDESRM),(IA(28),IDESKL),(IA(32),LOST),
     1		(IA(36),MBR),(IA(40),IDST),(IA(44),NMPL),
     1		(IA(48),TIMES),(IA(53),ISCRE),(IA(60),NTPRB),
	1	(IA(61),NTPWR),(IA(62),NTFOD),(IA(63),NTDMC),
	1	(IA(64),NTBWD),(IA(65),NTLPR),(IA(66),NTAWD)
	EQUIVALENCE (IPS(1),USR1),(IPS(9),PASS1)
	OPEN(UNIT=1,NAME='ENTR.DAT',ACCESS='APPEND',
     1	TYPE='UNKNOWN')
	USR=USR3
	T=SECNDS(0.0)
	PRINT 10
 10	FORMAT(1X,'WELCOME !!......... YOU MUST BE NEW !',//////)
	PRINT 20
 20	FORMAT(1X,'BEFORE WE SET YOU LOSE IN A STARSHIP YOU MUST'
     1		,' UNDERGO EXTREME AND')
	PRINT 30
 30	FORMAT(1X,'INTENSIVE MENTAL AND PHYSICAL DURESS SO THAT WE'
     1		,' WILL BE ABLE TO DETERMINE')
	PRINT 40
 40	FORMAT(1X,'THAT YOU ARE, INDEED, STARFLEET MATERIAL')
	PRINT 50
 50	FORMAT(1X,///,1X,'ONCE YOU START THERE IS NO TURNING BACK !')
	PRINT 60
 60	FORMAT(1X,//,1X,'DO YOU WISH TO TRY FOR THE STARLEET STAR'
     1		,'SHIP COMMAND TRAINING (Y/N) ?',$)
	ACCEPT 70,ANS
 70	FORMAT(A10)
	IF (ANS .NE. 'Y') GO TO 5000
	PRINT 80
 80	FORMAT(1X,/,1X,'DO YOU AGREE NOT TO HOLD STARFLEET, ANY OF'
     1		,' ITS MEMBERS, OR THE ')
	PRINT 90
 90 	FORMAT(1X,'FEDARATION OF PLANETS RESPONSIBLE TO ANY PHYSICAL'
     1		,' OR MENTAL MAIMINGS IN ANY FORM')
	PRINT 100
 100	FORMAT(1X,'INCURRED BY THE TRAINING UPON YOURSELF (Y/N) ?',$)
	ACCEPT 70,ANS
	IF (ANS .NE. 'Y') GO TO 5000
	PRINT 110
 110	FORMAT(1X,///,1X,'VERY WELL..... HERE WE GO (GOOD LUCK)')
	PRINT 111
 111	FORMAT(1X,'..... FIRST A FEW GENERAL QUESTIONS')
	CALL TIME(TME)
	CALL DATE(DTE)
	WRITE(1,122)TME,DTE
122	FORMAT(A20,A20)
	PRINT 114
 114	FORMAT(1X,///,1X,'ARE YOU MALE OR FEMALE :',$)
	ACCEPT 113,WHERE
	WRITE(1,121),WHERE
	PRINT 112
 112	FORMAT(1X,'WHERE DID YOU FIRST HEAR ABOUT THE STAR'
     1		,'FLEET (ONE LINE ANS. PLEASE)')
	ACCEPT 113,WHERE
 113	FORMAT(A80)
 121	FORMAT(1X,A80)
	WRITE (1,121),WHERE
	PRINT 115
 115	FORMAT(1X,/,1X,'HAVE YOU EVER BEEN CONVICTED OF A FELONEY :',$)
	ACCEPT 113,WHERE
	IF (WHERE .EQ. 'YES') THEN
	PRINT 116
 116	FORMAT(1X,'PLEASE DESCRIBE THE CRIME AND SENTANCE (ONE LINE'
     1		,' PLEASE)')
	ACCEPT 113,WHERE
	WRITE (1,121),WHERE
	ENDIF
	PRINT 117
 117	FORMAT(1X,///,1X,'THANK YOU ..... ')
	PRINT 120
 120	FORMAT(1X,//////////,1X,'PHASE #1.....  MENTAL ALERTNESS')
	PRINT 131
 131	FORMAT(1X,//,1X,'PLEASE READ THE DIRECTIONS CAREFULLY',///)
	PRINT 130
 130	FORMAT(1X,//,1X,'BELOW ARE A SERIES OF PROBLEMS WHICH MUST BE'
     1		,' SOLVED IN THE ALOTTED TIME.')
	PRINT 140
 140	FORMAT(1X,'WHEN THE TIME ALLOTTED APPEARS AND WHEN YOU ARE'
     1		,' READY HIT RETURN AND THE PROBLEM WILL APPEAR.')
	PRINT 150
 150	FORMAT(1X,//,1X,'ARE YOU READY TO PROCEDE (Y/N) ?',$)
	ACCEPT 70,ANS
	I1=SECNDS(T)
	IF (ANS .NE. 'Y') GO TO 5000
	DO 160 I=1,10
		PRINT 155
 155	FORMAT(1X,///,1X,'TIME ALLOTED :  5 SECONDS',$)
	ACCEPT 70,ANS
	T=SECNDS(0.0)
	CALL RANDU(I1,I2,X)
	CALL RANDU(I1,I2,Y)
	IX=X*100
	IY=Y*100
	PRINT 170,IX,IY
 170	FORMAT(1X,//,1X,I4,' + ',I4,' =',$)
	ACCEPT 175,NUM
 175	FORMAT(I10)
	AL=SECNDS(T)
	IF (AL .GT. 5) THEN
		PRINT 180
 180	FORMAT(1X,'SORRY, TIME WAS UP')
		GO TO 160
	ENDIF
	IF (NUM .NE. IX+IY) THEN
		PRINT 185
 185	FORMAT(1X,'THE ANSWER IS INCORRECT')
	ELSE
		PRINT 190
 190	FORMAT(1X,'CORRECT !!')
		IRIGHT=IRIGHT+1
	ENDIF
 160	CONTINUE
	PRINT 200
 200	FORMAT(1X,/////,1X,'..........PHASE #1 COMPLETE')
	PRINT 210,IRIGHT
 210	FORMAT(1X,//,1X,'YOU HAD ',I3,' CORRECT OUT OF 10')
	IF (IRIGHT .LT. 7) THEN
		PRINT 220
 220	FORMAT(1X,//,1X,'SORRY BUT YOU ARE NOT MATERIAL FIT FOR'
     1		,' FOR THE STARFLEET ! TRY AGAIN LATER.')
		STOP
	ENDIF
	PRINT 230
 230	FORMAT(1X,///,1X,'VERY GOOD !!')
	PRINT 240
 240	FORMAT(1X,///,1X,'THE NEXT PHASE TESTS YOU PHYSICAL ABLITIES')
	PRINT 150
	ACCEPT 70,ANS
	IF (ANS .NE. 'YES') THEN
		PRINT 250
 250	FORMAT(1X,'TO BAD, YOU''RE GOING ANYWAY')
	ENDIF
	PRINT 260
 260	FORMAT(1X,///,1X,'PHASE #2 ..... PHYSICAL ABILITIES')
	PRINT 270
 270	FORMAT(1X,///,1X,'PLEASE GO OUT AND JOG 5 MILES, HIT RETURN'
     1		,' WHEN YOU FINISH')
	ACCEPT 70,ANS
	PRINT 280
 280	FORMAT(1X,//,1X,'VERY GOOD ! YOU SEEM, INDEED, TO BE A '
     1		,'PHYSICALLY FIT PERSON.')
	PRINT 290
290	FORMAT(1X,//,1X,'EXCERCISE TIME :')
	PRINT 300
 300	FORMAT(1X,'PLEASE HIT RETURN AFTER YOU HAVE COMPLETED THE '
     1		,'SHOWN EXCERCISE')
	PRINT 310
 310	FORMAT(1X,//,1X,'100 SITUPS   :',$)
	ACCEPT 70,ANS
	PRINT 320
 320	FORMAT(1X,'50 PUSHUPS   :',$)
	ACCEPT 70,ANS
	PRINT 330
 330	FORMAT(1X,'150 JUMPING JACKS   :',$)
	ACCEPT 70,ANS
	PRINT 340
 340	FORMAT(1X,'75 CHINPUS   :',$)
	ACCEPT 70,ANS
 	PRINT 350
 350	FORMAT(1X,'HEY !! I ONLY COUNTED 74 ! DO THEM AGAIN !!')
	PRINT 340
	ACCEPT 70,ANS
	PRINT 360
360	FORMAT(1X,////,1X,'CONGRADULATIONS !! YOU HAVE PASSED.')
	PRINT 361
 361	FORMAT(1X,//,1X,'YOU ARE NOW A MEMBER OF STARFLEET')
	RETURN
5000	PRINT 5001
 5001	FORMAT(1X,'WELL !!! WE DON''T WANT YOU ANYWAYS !!')
	STOP
	END
C
C
