{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

COMP 1210 Exam 2 001 - flit" k Lit/J fi'v'il Giff...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: flit". k? Lit/J fi'v'il Giff)? fol“. Spring 2011 Exam 2 — 3f30f2011 — Page 1 of i' Last Name: % Fiist Name: m Multiple Choice (449 items @ 2.5 pain! each) Select [he letter in front of the must cement answeri and mark your soantron aeoordinglv. 1. Which of the following for loops iterates exaeflyfi times? H l u a. for [int j = 1; i r: 5; i——] (Pay for in: i — 1.- ; <= 5. i++) o. for (int i = ll: i <— 5' i-|+) d. for (in: i = I}; i c: 5; i——] e. for (in: i = 1: i c S; i-H-l l3.) Suppose that a method is invoked a; follow: obj.validate{"n“, 3. i‘, 5.r 1}; Which of the following method headers is correct for the validate method? a. public boolean validatofint p} in. public static boolean validateiSLring i, inl'. pi c. public void validateEString i, int pl '3 public hoolcan validateEString i, int . .. p]: vs. public static, void validatelstting i. ihtll 3‘1] 3. Which of the following is not a software development activity? a. testing In. implementation 11:. design (1. requirements fil none oi‘ihe above 4. What is the value ofgueianm after the following code ends execution with no exception? Scanner stdIn = new SeanneflSy-steminl; int guessblum 7 CI: do -: guesslilurr. = Integer.parselnt[stdInlncxtLine-H ,‘I; whilelguessfium <= 0}; A user—defined value greater than 0 A user—defined value greater than or equal to El guessNum will always be t] A user-defined value less ihan or equal to O A user—defined value loss 1han 0 Fri-PETE} 5. Which of the following lines nfeede stores the command line argument that is underlined below when running the Balloon program? b java Balloon Shirt true 4 B 3 C33 String temp T args [1] [1. String temp = orgs[2] c. SLI'iULJ temp = aros[3] @ hoo.l.nnn temp = argnflj e. hooligan;- Lamp = a:qe[2] ...
View Full Document

{[ snackBarMessage ]}