{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Exercise5Chp4Solut-1

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

Info icon This 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.
Image of page 1

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

View Full Document Right Arrow Icon
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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern