CSE182Midterm2Fall2009Solution-1

CSE182Midterm2Fall2009Solution-1 - CSE182 Appl Problem...

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

View Full Document Right Arrow Icon
1 CSE182 Appl. Problem Solving with C# (Fall 2009) Mid-term Test #2 First Name: ________________________ Last Name: ____________________________ Please take note of the following: Please write your name in the space above. Go through each question quickly. It is important that you write legibly, unreadable answer will receive no grades. Number of minutes you have: 50 Total points of the test: 90
Background image of page 1

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

View Full Document Right Arrow Icon
2 I: True/False (1 pts each, total 10 pts) Indicate whether the statement is true or false. Write “T” if it is true and “F” if it is false. _ T ___ 1. Methods are the members of a class that perform an action, and through writing methods you describe the behavior of the class. _ F ___ 2. To compute 2 3 , in order to invoke the predefined Pow ( ) method in the Math class, we write Math.Pow(3, 2). _ F ___ 3. After completing the called method’s body, control is returned to the last statement in the method that made the call. _ T ___ 4. Instance data is declared at the class level and it can be used by all methods in the class. _ T ___ 5. The process of using the same method name for multiple methods with different signatures is called method overloading. _ T ___ 6. Encapsulation is the concept that the variables contained in an object should be modified only within the object. _ F ___ 7. The name of the method, modifiers, return type, and the types of its formal parameters make up the signature of the method. __ F __ 8. Property is a special method that is used to set up a newly created object. _ T ___ 9. With the private keyword, data or methods can be accessed only from inside the class. _ T ___ 10. Local variables are declared within a method and it can be used only in that method. II: Multiple Choice (2 pts each, total 20 pts) Identify the choice that best completes the statement or answers the question. _ c ___ 1. The return type is physically placed _____. a. inside the method b. as the first entry in the method heading c. immediately preceding the name of the method d. immediately following the name of the method _ d ___ 2. Constructors should be defined with a _____ access modifier. a. static c. private b. protected d. public _ c ___ 3. The first line of a method is called the method _____. a. signature c. heading b. definition d. declaration
Background image of page 2
3 Console.WriteLine(“Final Grade = {0:N2}”, CalculateGrade(85,75,93)); _ a ___ 4. The {0:N2} above indicates the _____. a.
Background image of page 3

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

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

{[ snackBarMessage ]}

Page1 / 10

CSE182Midterm2Fall2009Solution-1 - CSE182 Appl Problem...

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