http://learn.cemetech.net/index.php?title=TI-BASIC:Review_Answers&feed=atom&action=historyTI-BASIC:Review Answers - Revision history2024-03-29T10:27:15ZRevision history for this page on the wikiMediaWiki 1.34.0http://learn.cemetech.net/index.php?title=TI-BASIC:Review_Answers&diff=1531&oldid=prevMaintenance script: Automated internal link correction2016-02-24T23:22:15Z<p>Automated internal link correction</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 23:22, 24 February 2016</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l428" >Line 428:</td>
<td colspan="2" class="diff-lineno">Line 428:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><div style="margin-left: 35px;"></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><div style="margin-left: 35px;"></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>'''Answer''': Just use the [[TI-BASIC:<del class="diffchange diffchange-inline">List►matr(</del>|List►matr(]] command.</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>'''Answer''': Just use the [[TI-BASIC:<ins class="diffchange diffchange-inline">List_Matr</ins>|List►matr(]] command.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></div></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></div></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
</table>Maintenance scripthttp://learn.cemetech.net/index.php?title=TI-BASIC:Review_Answers&diff=1061&oldid=prevMaintenance script: Initial automated import2016-02-24T18:32:39Z<p>Initial automated import</p>
<p><b>New page</b></p><div><div style="padding-bottom:10px;"><br />
<br />
As a way to test your comprehension of the information, and to ensure that you actually read through the information <br />
instead of merely skimming over it, we have provided review exercises. These exercises provide a way of helping you apply the information, so that you get a fuller understanding of the concepts.<br />
<br />
</div><br />
<br />
'''1'''. ''True'' or ''False'': The ClrHome command should be used at the end of a program, to ensure that the program does not leave any leftover text on the home screen.<br />
<div style="margin-left: 35px;"><br />
'''Answer''': True. Although you still will have a Done message at the end. To eliminate this you can add this to the end of your code Output(1,1," <br />
<br />
</div><br />
<br />
'''2'''. What type of variable cannot hold a complex number?<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': Matrix.<br />
</div><br />
<br />
'''3'''. Which of the following uses of the Disp command returns an error?<br />
# Disp<br />
# Disp ""<br />
# Disp "Hello World<br />
# Disp "Hello","World<br />
# None of the above.<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': None of above.<br />
</div><br />
<br />
'''4'''. Which draw command cannot be called from a program?<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': [[TI-BASIC:Pen|Pen]]. It's technically not a command, but it is accessed in the draw menu like a command.<br />
</div><br />
<br />
'''5'''. What is the difference between the iPart( and int( commands?<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': The difference between [[TI-BASIC:Ipart|IPart(]] and [[TI-BASIC:Int|Int(]] is subtle, and many people aren't even aware of it, but it exists. Whereas iPart( always truncates its parameters, simply removing the integer part, int( always rounds down. This means that they return the same answers for positive numbers, but int( will return an answer 1 less than iPart( for (non-integer) negative numbers. For example, iPart(-5.32) is -5, while int(-5.32) is -6.<br />
</div><br />
<br />
'''6'''. ''True'' or ''False'': Programs can use the home screen for everything they can do on the graph screen.<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': False. There are no graphics commands available on the home screen. <br />
</div><br />
<br />
'''7'''. What is the minimal modification that will allow this code to start-up?<br />
<br />
:Menu("Choose One,"Menu Item",1,"Menu Item",2<br />
:Lbl A<br />
:Pause "Item 1<br />
:Stop<br />
:Lbl 2<br />
:Pause "Item 2<br />
<br />
# Add a closing quote on the menu title.<br />
# Remove the Stop command.<br />
# Change Lbl A to Lbl 1.<br />
# Add a closing quote on the menu title and change Lbl A to Lbl 1.<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': Add a closing quote on the menu title.<br />
</div><br />
<br />
'''8'''. In a statistics class, the teacher asks the students to generate a list of 100 random numbers. Unfortunately, the exercise doesn't work as intended because 22 students, in a class of 30, get the exact same numbers (using different calculators). What's a likely explanation for this surprising coincidence?<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': They all had the [[TI-BASIC:Rand|Rand]] command seeded to zero.<br />
</div><br />
<br />
'''9'''. How many digits of accuracy does the TI-OS have? How many can it display on the screen?<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': It has fourteen digits of accuracy, but only ten will be displayed.<br />
</div><br />
<br />
'''10'''. The Output( command can display text at any place on the screen, but what happens when the text goes past the end of the line?<br />
# Nothing. The text simply does not show up.<br />
# An error is returned.<br />
# The text will wrap around to the next line.<br />
# An ellipsis will be displayed at the end of the line, with the rest of the text not being displayed.<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': The text will wrap around to the next line.<br />
</div><br />
<br />
'''11'''. ''True'' or ''False'': You need to use a Pause command before clearing the screen, otherwise the user will only see the text on the screen for a couple seconds; it will be a blur.<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': False. There are other options available, including using the [[TI-BASIC:Rand|Rand]] command for a short delay or using a small Repeat getKey:End loop.<br />
</div><br />
<br />
'''12'''. When is using the Menu command appropriate, and even desired? (Choose the best answer.)<br />
# If you want a generic menu.<br />
# Your program is going to be text-based.<br />
# It is the most practical menu available in your situation.<br />
# You want your program to stand out, so you need a fancy menu.<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': The first three answers are all good, but the best answer is if you want a generic menu.<br />
</div><br />
<br />
'''13'''. What would be the effect of replacing a Disp command with an Output command and vice versa? Give any instances where this switch might be useful.<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': The [[TI-BASIC:Output|Output(]] command doesn't scroll the screen when it gets to the bottom, like the [[TI-BASIC:Disp|Disp]] command does. The main instance where this is useful is when you have lots of text that you are displaying, and the Output( command will wrap it around to the next line.<br />
</div><br />
<br />
'''14'''. What is the maximum dimension of a list?<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': 999. Note, however, that a list that size would barely fit in RAM.<br />
</div><br />
<br />
'''15'''. Which one statement is true about this code?<br />
<br />
:Menu("","",B,"",B<br />
:Disp "Test<br />
:Lbl B<br />
:Disp "Pizza<br />
:Output(1,1,"Spaghetti<br />
<br />
# An error will be returned when the Menu( command is executed.<br />
# The program will execute, but there will not be any text displayed.<br />
# The "Test" text will be displayed along with the "Pizza" and "Spaghetti" text.<br />
# The "Pizza" and "Spaghetti" text will be displayed, but not the "Test".<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': The "Pizza" and "Spaghetti" text will be displayed, but not the "Test".<br />
</div><br />
<br />
'''16'''. ''True'' or ''False'': Before using the Menu( command, you need to clear the home screen, otherwise you will have text interrupting the menu.<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': False. The [[TI-BASIC:Menu|Menu(]] command uses its own screen, which is separate from the home screen.<br />
</div><br />
<br />
'''17'''. Consider the following code:<br />
<br />
:0:Menu("Difficulty","Easy",3,"Medium",2,"Hard",1<br />
:Lbl 1:Ans+1<br />
:Lbl 2:Ans+1<br />
:Lbl 3:Ans+1<br />
<br />
The Ans variable keeps track of the last answer, often being used in place of more permanent variables. If the user selects the "Hard" menu item, what will Ans's value be? What effect does the label ordering have on the value, if any?<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': [[TI-BASIC:Ans|Ans]]'s value will be three. The label ordering causes the value of Ans to be incremented by one for each difficulty level.<br />
</div><br />
<br />
'''18'''. ''True'' or ''False'': Using the home screen is faster than using the graph screen?<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': False. Both take the same time.<br />
</div><br />
<br />
'''19'''. Which of the following cannot be used to test if a variable is any of 1, 2, 3, or 4?<br />
<br />
# If sum(A={1,2,3,4<br />
# If (A=int(A))(A>=1)(A<=4)<br />
# If A={1,2,3,4}<br />
# If A(int(A)=A)(A<5)<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': If A={1,2,3,4} because the [[TI-BASIC:If|If]] command does not work with [[TI-BASIC:Lists|Lists]]. <br />
</div><br />
<br />
'''20'''. ''True'' or ''False'': The following is an alternate to using the or operator.<br />
<br />
<br />
:If (X=1)+(X=2<br />
<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': True.<br />
</div><br />
<br />
'''21'''. Name a command or function that cannot be interrupted by pressing the [ON] key.<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': [[TI-BASIC:Randbin|RandBin(]], [[TI-BASIC:Sorta|SortA(]], and [[TI-BASIC:Sortd|SortD(]] all will work.<br />
</div><br />
<br />
'''22'''. For which of the following would not(B) not equal 0?<br />
<br />
# .01→B<br />
# 0→B<br />
# π→B<br />
# -4→B<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': 0→B. Remember that [[TI-BASIC:Not|Not(]] negates the value, so 0 becomes 1.<br />
</div><br />
<br />
'''23'''. ''True'' or ''False'': The following is an alternative to using the and operator.<br />
<br />
<br />
:If Anot(B<br />
<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': True. Remember that [[TI-BASIC:Multiply|multiplication]] is implicitly done on the TI-83 calculators.<br />
</div><br />
<br />
'''24'''. How many bytes is an uppercase character? A lowercase character?<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': An uppercase character is one byte, while a lowercase character is two bytes.<br />
</div><br />
<br />
'''25'''. Which of these user-created list names are actually possible on the calculator?<br />
<br />
# L1234<br />
# LBaDd<br />
# Lθθθθ<br />
# LABCD<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': Lθθθθ and LABCD. A list can't start with a number, and lowercase letters aren't allowed.<br />
</div><br />
<br />
'''26'''. What type of variable needs a special command to store to it?<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': Picture and GDB. You use the [[TI-BASIC:Storepic|StorePic]] and [[TI-BASIC:Storegdb|StoreGDB]] command. <br />
</div><br />
<br />
'''27'''. Change this short program so it doesn't flicker and then optimize it as much as possible.<br />
<br />
<br />
:4→X:4→Y:Repeat 0<br />
:ClrHome<br />
:Output(Y,X,"X")<br />
:getKey→K<br />
:If K=24:X-1→X<br />
:If K=25:Y+1→Y<br />
:If K=26:X+1→X<br />
:If K=34:Y-1→Y<br />
:End<br />
<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': Here is one possibility:<br />
<br />
<br />
:4→X:4→Y:Repeat 0<br />
:Output(Ans,X,"X<br />
:Repeat Ans:getKey→K:End<br />
:Output(Y,X," // 1 space<br />
:X+(Ans=26)-(Ans=24→X<br />
:Y+(K=34)-(K=25→Y<br />
:End<br />
<br />
</div><br />
<br />
'''28'''. ''True'' or ''False'': You can archive another program from within a program.<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': False. You can, however, archive another program outside a program.<br />
</div><br />
<br />
'''29'''. What is the maximum length of a string?<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': There is none. It is only limited by the amount of RAM.<br />
</div><br />
<br />
'''30'''. Which of the following variables is it possible to archive?<br />
<br />
# Y,,1,,<br />
# prgmKEWLGAME<br />
# the real variable T<br />
# the real variable A<br />
# ∟RESID<br />
# L,,1,,<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': prgmKEWLGAME, the real variable A, and L,,1,,. Trying to archive Y,,1,,T,, and ∟RESID will give you an [[TI-BASIC:Errors#variable|ERR:VARIABLE]] error.<br />
</div><br />
<br />
'''31'''. Without trying it first, is this legal?<br />
<br />
<br />
:[A]L4([A]([A](L1(1),L2(1)),L1(1(L2(2L3<br />
<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': No. While the syntax is correct, an error is returned when trying to get the particular element multiplied by the entire ,,L,,3 list.<br />
</div><br />
<br />
'''32'''. How would you find the fifth element from the last in a sequence of 20 elements?<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': Assuming the list is L1, you would just use:<br />
<br />
<br />
:L1(15<br />
<br />
</div><br />
<br />
'''33'''. What will this code do?<br />
<br />
<br />
:DelVar B1→A<br />
:If A:If B<br />
:Disp "Hello World<br />
<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': Nothing. It doesn't output anything on the screen.<br />
</div><br />
<br />
'''34'''. How do you get rid of the Done message at the end of a program?<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': You can remove the "Done" message that appears after a program is finished running by placing an expression, some text, or just a quote on the last line of your program. <br />
</div><br />
<br />
'''35'''. Write a program that inputs a string and outputs the letters backward, one per line.<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': Here is one possibility:<br />
<br />
<br />
:Input "TEXT:",Str1<br />
:For(X,length(Str1),1,-1<br />
:Disp sub(Str1,X,1<br />
:rand(10<br />
:End<br />
<br />
</div><br />
<br />
'''36'''. Will this code execute?<br />
<br />
<br />
:If 0:Disp "Your turn<br />
:Else:Disp "Guess not<br />
<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': No, it will give you an error.<br />
</div><br />
<br />
'''37'''. What is the simplest program you can have that has recursion?<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': A one-liner that just calls itself:<br />
<br />
<br />
PROGRAM:A<br />
:prgmA<br />
<br />
</div><br />
<br />
'''38'''. Which of these are logically equivalent?<br />
<br />
# not(P or Q)<br />
# P and Q<br />
# not(P and Q)<br />
# not(P) or not(Q)<br />
# not(P) and not(Q)<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': "not(P or Q)" and "not(P) and not(Q)" are logically equivalent, while "not(P and Q)" and "not(P) or not(Q)" are logically <br />
equivalent. This is based off of DeMorgan's Law.<br />
</div><br />
<br />
'''39'''. ''True'' or ''False'': There are actually 256 picture variables on the calculator, even though only 10 picture <br />
variables show up.<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': True. Although the other 246 must be accessed through asm.<br />
</div><br />
<br />
'''40'''. What are the differences between assembly and TI-Basic? When would you use assembly and when would you use TI-Basic?<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': Unlike TI-Basic, which uses commands and functions that are easy to understand, assembly is programmed in the calculator's own machine language, and thus is much harder to program in and read. You would use assembly when you want your program to be fast, and you would use TI-Basic when you want to program your game fast.<br />
</div><br />
<br />
'''41'''. How long will the program go through the loop until it stops execution?<br />
<br />
<br />
:0→X<br />
:While X<br />
:Disp "Another Loop<br />
:X+1→X<br />
:If X=25<br />
:Stop<br />
:End<br />
<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': Trick question the while loop is false.So X never changes and it ends at 0.<br />
</div><br />
<br />
'''42'''. What is wrong with this code?<br />
<br />
<br />
:If X=25 Then<br />
:Disp "X is 25<br />
:X+1→X<br />
:Disp "X is now", X<br />
:End<br />
<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': You need to change the space between X=25 and Then to a colon, and remove the space to the left of the second X in Disp "X is now", X:<br />
<br />
<br />
:If X=25:Then<br />
:Disp "X is 25<br />
:X+1→X<br />
:Disp "X is now",X<br />
:End<br />
<br />
</div><br />
<br />
'''43'''. What are the only keys that will be repeated if they are held down?<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': The arrow keys and DEL.<br />
</div><br />
<br />
'''44'''. How would you go about converting a list to a matrix? What would the code look like?<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': Just use the [[TI-BASIC:List►matr(|List►matr(]] command.<br />
</div><br />
<br />
'''45'''. ''True'' or ''False'': There is no built-in way to convert a string to a number.<br />
<br />
<div style="margin-left: 35px;"><br />
'''Answer''': False. The [[TI-BASIC:Expr|Expr(]] command does this.<br />
</div>[[Category:TI-BASIC]]<br />
[[Category:TIBD]]</div>Maintenance script