Advertisement
Guest User

103 and 4

a guest
Apr 1st, 2015
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. '**********************
  2. '
  3. 'Daniel Venegas
  4. 'CIS 1359
  5. 'Program 10.3
  6. 'Apr 1 2015
  7. '
  8. 'This program prints a table showing x, x^2, x^3, and
  9. 'x^.5 for x = 1 to 10, using a for/next loop.
  10. '***********************
  11. 'Variable list
  12. '
  13. 'X- computer controlled, numeric, the number counted
  14. 'fr$- computer controlled, string, a formatting string
  15. ' used to make the output pretty
  16. 'root#- computer controlled, numeric, i don't think i
  17. ' needed this one, but i put it in previously
  18. ' because there was an issue with the format
  19. ' string, while i thought the issue was with
  20. ' the number
  21. '************************
  22.  
  23. CLS
  24. PRINT " X X^2 X^3 X^(1/2)"
  25. fr$ = "#### #### #### #.###"
  26. FOR X = 1 TO 10
  27. root# = X ^ .5
  28. PRINT USING fr$; X; X ^ 2; X ^ 3; root#
  29. NEXT
  30. END
  31.  
  32.  
  33.  
  34. '***********************
  35. '
  36. 'Daniel Venegas
  37. 'CIS 1359
  38. 'Program 10.4
  39. 'Apr 1 2015
  40. '
  41. 'This program tracks the value of an investment that
  42. 'doubles each day over 30 days
  43. '***********************
  44. 'Variable List
  45. 'F1$- computer controlled, string, used to format
  46. ' numbers
  47. 'F2$- computer controlled, string, also used to
  48. ' format numbers. woohoo
  49. 'Day- computer controlled, numeric, a counter that
  50. ' is used to tell the current day
  51. 'Amt- computer controlled, numeric, the value of the
  52. ' investment that doubles each day
  53. '************************
  54. CLS
  55. PRINT " DOUBLE OR NOTHING INVESTMENT COMPANY"
  56. PRINT " DAY AMOUNT DAY AMOUNT "
  57. F1$ = " ## #########.## "
  58. F2$ = " ## #########.## "
  59. Amt = .01
  60. FOR Day = 1 TO 15
  61. Amt = Amt * 2
  62. NEXT
  63. LOCATE 3
  64. FOR Day = 16 TO 30
  65. PRINT USING F2$; Day; Amt
  66. Amt = Amt * 2
  67. NEXT
  68. Amt = .01
  69. LOCATE 3
  70. FOR Day = 1 TO 15
  71. PRINT USING F1$; Day; Amt
  72. Amt = Amt * 2
  73. NEXT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement