Ask your own question, for FREE!
Computer Science 8 Online
OpenStudy (anonymous):

Need help with 4 questions! Will give medal and be a fan :)

OpenStudy (anonymous):

2. Which statement requires an index value? a. if then b. if then else c. switch d. for

OpenStudy (anonymous):

3. which statement first prints the result and then it checks for condition? a. do-while** guessing its this b. for c. while d. switch

OpenStudy (anonymous):

which statement is used to give the program multiple options? a. for b. do c. switch d. if-then-else

OpenStudy (anonymous):

@amistre64

OpenStudy (amistre64):

whats your idea on the last one?

OpenStudy (anonymous):

I thought it was for because it runs code for each item but i think its do too

OpenStudy (anonymous):

do loops while the condition is true

OpenStudy (amistre64):

if-then-else can be used in place of a switch command, but the switch command is pretty much the norm for multiple option choices i believe

OpenStudy (anonymous):

okay so its switch. am i correct for number 3?

OpenStudy (amistre64):

i like #3, i cant verify if its correct tho

OpenStudy (amistre64):

and what does an index value do for us?

OpenStudy (anonymous):

pair of numbers in the table

OpenStudy (anonymous):

waittt i got it

OpenStudy (amistre64):

:) i was thinking an index value was used to loop thru a for statement

OpenStudy (e.mccormick):

The other name for an index value is an iterator. To iterate is to "perform or utter repeatedly." So something that deals with repetition.

OpenStudy (e.mccormick):

``` do { Some command } while(test condition) ``` That is the basics of a do-while loop in any language.

OpenStudy (anonymous):

for #2 the answer is for loop ie. for(int i = 0; i < n; i++) int i = 0; for #3 you are correct with the do while ie do (something) while(i < 1)this loop will iterate even though i is 0 .the test is while i < 1 for multiple choices the correct answer is the switch statement ie.. swith int case'1' case'2' case'3' default exit statement

OpenStudy (anonymous):

do { while(i >1) the loop will iterate if i is 0 i miss typed it

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!