home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / basic / astrmenu.lbr / ADDMAG.BZS / ADDMAG.BAS
BASIC Source File  |  1987-04-26  |  896b  |  30 lines

  1. 1 PRINT "From the April 1985 SKY & TELESCOPE, p. 359."
  2. 2 PRINT
  3. 3 PRINT "This program calculates the combined magnitude of two stars whose"
  4. 4 PRINT "magnitudes are individually known and includes a loop so that"
  5. 5 PRINT "additional stars may be combined."
  6. 6 PRINT
  7. 7 PRINT "INPUT:  First and second star magnitudes."
  8. 8 PRINT
  9. 9 PRINT "OUTPUT:  Total magnitude, count of stars combined." : PRINT
  10. 10 REM ADDING MAGNITUDES
  11. 15 REM
  12. 20 B=100^.2 : N=2 : C=LOG(10)
  13. 25 INPUT "1ST STAR MAG";M1
  14. 30 INPUT "2ND STAR MAG";M2
  15. 35 M=B^-M1+B^-M2
  16. 40 M=-2.5*LOG(M)/C
  17. 45 PRINT "TOTAL MAG:  ";M
  18. 50 M1=M : N=N+1 : PRINT
  19. 55 INPUT "ANOTHER STAR (ENTER X TO END):  ",M$
  20. 60 IF M$="X" THEN 75
  21. 65 IF M$>"9" THEN 55
  22. 70 M2=VAL(M$) : GOTO 35
  23. 75 PRINT "STAR COUNT:  ";N-1
  24. 80 RUN "ASTRMENU.BAS"
  25. ,M$
  26. 60 IF M$="X" THEN 75
  27. 65 IF M$>"9" THEN 55
  28. 70 M2=VAL(M$) : GOTO 35
  29. 75 PRINT "STAR COUNT:  ";N-1
  30. 80 RUN "A