1 / 11

True BASIC Ch. 8 Practice Questions

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))

idona-cobb
Download Presentation

True BASIC Ch. 8 Practice Questions

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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. 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

  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. 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

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

  7. 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”

  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) PRINT 1+INT(RND*100), 1+INT(RND*100) 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) 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

More Related