SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Barbara Dolye
Chapter:
Creating Your Own Classes
Exercise:
Exercises
Question:21 | ISBN:9781285096261 | Edition: 4

Question

Given the following code snippet:
public class Camera                                                                   Line 1
    {                                                                                             Line 2
private double zoom;                                                                   Line 3
private double lensSpeed;                                                            Line 4
public double Zoom                                                                     Line 5
    {                                                                                             Line 6
get                                                                                              Line 7
  {                                                                                               Line 8
return zoom;                                                                                Line 9
   }                                                                                              Line 10
   }                                                                                              Line 11
public Camera ( )                                                                          Line 12
     {                                                                                            Line 13
   }                                                                                               Line 14
public Camera (double zCapacity,                                                  Line 15
double ls)                                                                                    Line 16
   {                                                                                                Line 17
int xValue = 2;                                                                              Line 18
zoom = zCapacity * xValue;                                                           Line 19
lensSpeed = ls;                                                                             Line 20
    }                                                                                                Line 21
public double GetLensSpeed( )                                                        Line 22
       {                                                                                             Line 23
return lensSpeed ;                                                                           Line 24
   {                                                                                                  Line 25
Identify the following items by line number:
a. method headings
b. property identifier
c. default constructors
d. formal parameters
e. local variables

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Sorry the answer is not available at the moment…

If you are able to find the answer, please make sure to post it here. So that your Juniors have smile on their lips and feel happy.

Spread the 'tradition of sharing'.