110 likes | 197 Views
True BASIC Ch. 8 Practice Questions. 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))
E N D
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.449 -15.5 15 15 15.45 16 20 15 4 15 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
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 1 0 -3 4 1 0 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
Suppose it is 5 minutes past Midnight on January 25th , 2010. What value corresponds to these statements? DATE TIME DATE$ TIME$
Suppose it is 5 minutes past Midnight on January 25th , 2010. What value corresponds to these statements? DATE 10025 TIME 300 (5 mins * 60 sec / min) DATE$ “20100125” TIME$ “00:05:00”
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))
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
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) PRINT 1+INT(RND*100), 1+INT(RND*100) PRINT 1+INT(RND*100), 1+INT(RND*100) END
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) PRINT 1+INT(RND*100), 1+INT(RND*100) PRINT 1+INT(RND*100), 1+INT(RND*100) END Missing RANDOMIZE, so the winning numbers would be the same every day