Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

PART II-MULTIPLE CHOICE Record your answers on the separate answer sheet. Select

ID: 3917991 • Letter: P

Question

PART II-MULTIPLE CHOICE Record your answers on the separate answer sheet. Select the choice that best completes each statement or answers the question Each question is worth 1 point. 18. For the string gr "graduation", what is the result of gr,substring(2,5)tgr,length0+gr.Indexoff"u")? A. aduat 104 B. adualS C. aduat 14 D. adua 104 E. adua14 19. An example of a repetition structure is an) A. if B. doobee/doobee/do loop C. assignment D. while loop E. method 20. An example of a selection structure is a(n) A. if B. algorithm C. do/while loop D. for loop E. comparison 21. An invalid data type for Java is A. char B. float C. decimal D. int E. double 22. What is wrong with the following do/while loop? int sum # 0; int counter 1; do sum t counter; system. out.println (sum); while (counter

Explanation / Answer

Following is the answer:

18) D adua104
19) D while loop
20) A if
21) C decimal
22) D it is an infinite loop