Exercise5Chp4Solut-1

Exercise5Chp4Solut-1 - d ____ a special method that is used...

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

View Full Document Right Arrow Icon
Name________________________ CSE182 1 CSE 182 Exercise #5 (Chapter 4) Solution 1) For each terminology below, match its corresponding description: a. Encapsulation g. method overloading b. public visibility modifier h. static method c. private visibility modifier d. constructor e. instance variable f. local variable g ____ the process of using the same method name for multiple methods with different definitions when their signatures are different. h ____ it can invoke only static methods and cannot invoke non-static methods without associating them with class names or objects. a ____ the concept that the variables contained in an object should be modified only within the object. b ____ with this, data or methods can be accessed from anywhere. e ____ data is declared at the class level and it can be used by all methods in the class. c ____ with this, data or methods can be accessed only from inside the class.
Background image of page 1

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

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

Unformatted text preview: d ____ a special method that is used to set up a newly created object. f ____ data is declared within a method and it can be used only in that method. 2). Convert the following algebraic expressions into valid C# code. a. C B A (A+B)/C b. 2 2 B A Math.Sqrt(Math.Pow(A,2)+Math.Pow(B,2)) c. Y X C B A (A+B*C)/(X-Y) d. | A B | Math.Abs(A-B) e. A B Math.Pow(A,B) Name________________________ CSE182 2 3) What will be the value of answer after executing each of the following? double answer; a. answer = Math.Floor(43.2); 43 b. answer = Math.Max(53.43, 23.3); 53.43 c. answer = Math.Abs(-65.3); 65.3 d. answer = Math.Sqrt(4); 2 e. answer = Math.Pow(2,3); 8 f. answer = Math.Ceiling(76.2); 77 g. answer = Math.Min(23.43, 43.2); 23.43 h. answer = Math.Round(43.242789678, 3); 43.243...
View Full Document

This note was uploaded on 02/11/2010 for the course CSE CSE182 taught by Professor Feng during the Spring '10 term at ASU.

Page1 / 2

Exercise5Chp4Solut-1 - d ____ a special method that is used...

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

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