Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '**********************
- '
- 'Daniel Venegas
- 'CIS 1359
- 'Program 10.3
- 'Apr 1 2015
- '
- 'This program prints a table showing x, x^2, x^3, and
- 'x^.5 for x = 1 to 10, using a for/next loop.
- '***********************
- 'Variable list
- '
- 'X- computer controlled, numeric, the number counted
- 'fr$- computer controlled, string, a formatting string
- ' used to make the output pretty
- 'root#- computer controlled, numeric, i don't think i
- ' needed this one, but i put it in previously
- ' because there was an issue with the format
- ' string, while i thought the issue was with
- ' the number
- '************************
- CLS
- PRINT " X X^2 X^3 X^(1/2)"
- fr$ = "#### #### #### #.###"
- FOR X = 1 TO 10
- root# = X ^ .5
- PRINT USING fr$; X; X ^ 2; X ^ 3; root#
- NEXT
- END
- '***********************
- '
- 'Daniel Venegas
- 'CIS 1359
- 'Program 10.4
- 'Apr 1 2015
- '
- 'This program tracks the value of an investment that
- 'doubles each day over 30 days
- '***********************
- 'Variable List
- 'F1$- computer controlled, string, used to format
- ' numbers
- 'F2$- computer controlled, string, also used to
- ' format numbers. woohoo
- 'Day- computer controlled, numeric, a counter that
- ' is used to tell the current day
- 'Amt- computer controlled, numeric, the value of the
- ' investment that doubles each day
- '************************
- CLS
- PRINT " DOUBLE OR NOTHING INVESTMENT COMPANY"
- PRINT " DAY AMOUNT DAY AMOUNT "
- F1$ = " ## #########.## "
- F2$ = " ## #########.## "
- Amt = .01
- FOR Day = 1 TO 15
- Amt = Amt * 2
- NEXT
- LOCATE 3
- FOR Day = 16 TO 30
- PRINT USING F2$; Day; Amt
- Amt = Amt * 2
- NEXT
- Amt = .01
- LOCATE 3
- FOR Day = 1 TO 15
- PRINT USING F1$; Day; Amt
- Amt = Amt * 2
- NEXT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement