Presentation is loading. Please wait.

Presentation is loading. Please wait.

True BASIC Ch. 8 Practice Questions. What is the output of this program? ---------------------------------------------------------- LET X = 15.449 PRINT.

Similar presentations


Presentation on theme: "True BASIC Ch. 8 Practice Questions. What is the output of this program? ---------------------------------------------------------- LET X = 15.449 PRINT."— Presentation transcript:

1 True BASIC Ch. 8 Practice Questions

2 What is the output of this program? ---------------------------------------------------------- LET X = 15.449 PRINT ABS(-1*X) PRINT MAX(X, -15.5) PRINT MIN(X, -15.5) PRINT ROUND(X) PRINT ROUND(X, 0) PRINT ROUND(X, 2) PRINT ROUND(ROUND(ROUND(X, 2),1)) PRINT ROUND(X, -1) PRINT INT(X) PRINT SQR(ROUND(X+1)) PRINT REMAINDER(INT(X), 16) END

3 What is the output of this program? ---------------------------------------------------------- LET X = 15.449 PRINT ABS(-1*X) PRINT MAX(X, -15.5) PRINT MIN(X, -15.5) PRINT ROUND(X) PRINT ROUND(X, 0) PRINT ROUND(X, 2) PRINT ROUND(ROUND(ROUND(X, 2),1)) PRINT ROUND(X, -1) PRINT INT(X) PRINT SQR(ROUND(X+1)) PRINT REMAINDER(INT(X), 16) END OUTPUT ------- 15.449 -15.5 15 15.45 16 20 15 4 15

4 What is the output of this program? ---------------------------------------------------------- PRINT INT(-99.9) PRINT INT(RND) PRINT ABS(ABS(-1)) PRINT SQR(3*3 + 4^2) PRINT SQR(1) PRINT REMAINDER(11, 10) PRINT REMAINDER(11, 11) PRINT MAX(MIN(-5,-4),MIN(-3,-2)) PRINT 1+SQR(3)*SQR(3) PRINT REMAINDER(44*123456+1,44) PRINT ROUND(1/12345) END

5 What is the output of this program? ---------------------------------------------------------- PRINT INT(-99.9) PRINT INT(RND) PRINT ABS(ABS(-1)) PRINT SQR(3*3 + 4^2) PRINT SQR(1) PRINT REMAINDER(11, 10) PRINT REMAINDER(11, 11) PRINT MAX(MIN(-5,-4),MIN(-3,-2)) PRINT 1+SQR(3)*SQR(3) PRINT REMAINDER(44*123456+1,44) PRINT ROUND(1/12345) END OUTPUT ------- -100 0 1 5 1 0 -3 4 1 0

6 Suppose it is 5 minutes past Midnight on January 25 th, 2010. What value corresponds to these statements? DATE TIME DATE$ TIME$

7 Suppose it is 5 minutes past Midnight on January 25 th, 2010. What value corresponds to these statements? DATE 10025 TIME 300 (5 mins * 60 sec / min) DATE$ “20100125” TIME$ “00:05:00”

8 What are the largest and smallest possible values of: INT(RND*100) INT(SQR(RND*100)) INT(MAX(RND*100, RND*10)) INT(MIN(RND*100, RND*10))

9 What are the largest and smallest possible values of: Smallest is zero for all. Largest is listed below INT(RND*100) 99 INT(SQR(RND*100)) 9 (highest perfect square < 100) INT(MAX(RND*100, RND*10)) 99 INT(MIN(RND*100, RND*10)) 9

10 What would be the problem with this program if it was used every day to determine the winner of a lottery? PRINT "Your Lucky Six Numbers Are:“ PRINT 1+INT(RND*100), 1+INT(RND*100) END

11 What would be the problem with this program if it was used every day to determine the winner of a lottery? PRINT "Your Lucky Six Numbers Are:“ PRINT 1+INT(RND*100), 1+INT(RND*100) END Missing RANDOMIZE, so the winning numbers would be the same every day


Download ppt "True BASIC Ch. 8 Practice Questions. What is the output of this program? ---------------------------------------------------------- LET X = 15.449 PRINT."

Similar presentations


Ads by Google