OldExamQuestions - DISC 3370 Exam 1 Fall 2001 Be sure to answer all questions in the context of text chapters If more than one answer seems

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
DISC 3370 Exam 1 Fall 2001 Be sure to answer all questions in the context of text chapters. If more than one answer seems technically correct, choose the best (most specific or appropriate) answer. If what your instructor presented in lecture conflicts with that in the book, choose the answer presented in class. Unless specifically directed otherwise, all questions are to be answered independently of each other. Good Luck No extra time will be given to fill in your scantron answer sheet. Answers on your scantron answer sheet are considered final 5/12/2009 5/12/2009 4f418c8db3047cba4f5ece4f3d0968524a95a79f.doc
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Use the following code for questions 1 through 7 1. String[] args in Line A is/are: a) Two arguments b) One argument c) A method d) The return data type e) A class-wide variable 2. After Line B executes, what will be the value of longVariable? a) 0 b) 0.9 c) 9.1 d) 10 e) 1 3. "private" in the first methodA() header means: a) This method can only be called by methods in other classes b) This method can only be called by methods in this class c) This method does not return a value d) This method can only be called by other private methods. e) This method can only be called by other private methods in this class. 4. In Line E, "System" is a) a method b) an object c) a field d) an attribute e) a variable 5. After executing Line C, the value of intVariable2 is a) 10.12 b) 1.1 c) 1.12 d) 1 e) 10 6. After executing Line D, the value displayed is a) 10 b) 700 c) 500 d) 800 e) 20 7. After executing Line E, the value displayed is a) 0 b) 60 c) 400 d) 600 e) 500 public class ExamSectionA { public static void main (String[] args) { int intVariable1 = 9; int intVariable2 = 10; double doubleVariable = 11.2; char charVariable = 'A'; long longVariable; longVariable = intVariable1 + 1 % intVariable2; intVariable2 = (int) (doubleVariable / 10f); String[] theirSalary = {"10","20","30","40"}; methodA(theirSalary[1]); System.out.println(theirSalary[1]); double[] yourSalary = {0, 60, 102, 156, 45}; methodA(yourSalary); System.out.println(yourSalary[1]); } private static void methodA(double[] salary) { salary[1] = 400; } private static void methodA(int[] salary) { salary[1] = 500; } private static void methodA(double salary) { salary = 600; } private static void methodA(String[] salary) { salary[2] = "700"; } private static void methodA(String salary) { salary = "800"; } } 4f418c8db3047cba4f5ece4f3d0968524a95a79f.doc 05/12/09 5:24 A5/P5 2 Line B Line C Line E Line D Line A
Background image of page 2
Use the following code for questions 8 through 12 8. When the code is executed, how many objects of class ExamSectionB1 are created? a) 1 b) 4 c) 2 d) 3 e) 5 9. In order to display the value of party for the object with Generic entertainer, the following code can be placed in Line A: a) System.out.println(jobs[1].getParty()); b) System.out.println(getParty()); c) System.out.println(jobs[1].party); d) the party for that object cannot be displayed from Line A. e)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/14/2008 for the course DISC 3331 taught by Professor Smith during the Spring '08 term at University of Houston.

Page1 / 9

OldExamQuestions - DISC 3370 Exam 1 Fall 2001 Be sure to answer all questions in the context of text chapters If more than one answer seems

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online