Questions 2-14-2011 - Copy (10) - Copy - Copy

Questions 2-14-2011 - Copy (10) - Copy - Copy - B. Char num...

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

View Full Document Right Arrow Icon
Sheet1 Page 1 1. If you want to get the first letter from a string, you do: A. CHARAT(1) B. CharAt(1) C. charAt(0) D. characterAt(1) E. charat(1) 2. When you need to get the length of a string, you use: A. myString.length() B. myString. C. length(myString) D. size(myString) E. none of the above. 3. To start dealing with a random variable, you declare it by: A. Random(r) B. Random r = new Random() C. Random.r D. r.Random E. r.Random() 4. To convert a variable of type String to an integer, yo do: A. char num = Integer.parseDouble(str)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: B. Char num = Integer.parseChar(str) C. String num = Integer.parseInteger(str) D. int num = Integer.parseInt(str) E. none of the above. 5. What is the Sentinel Loop? A. A loop that loops until a user enters something to exit. B. A loop that works exactly like the fence post, but it does not close at the end. C. A loop class that can be called by other programs to do specific tasks. D. A loop that keeps looping with no end condition. E. none of the above. Answers: 1. C 2. A 3. B 4. D 5. A...
View Full Document

This note was uploaded on 03/15/2011 for the course CS 126 taught by Professor Dr.koch during the Spring '11 term at Wilkes.

Ask a homework question - tutors are online