Question 1: If you follow the standard C# naming conventions, the property name
ID: 3722506 • Letter: Q
Question
Question 1: If you follow the standard C# naming conventions, the property name for the following instance variable would be:
private string name;
propertyName
nameProperty
getName
name
Name
Question 2:
public class Door Line 1
{ Line 2
private double height; Line 3
private double width; Line 4
public double Height Line 5
{ Line 6
get Line 7
{ Line 8
return height; Line 9
} Line 10
} Line 11
public Door ( ) Line 12
{ Line 13
} Line 14
public Door (double h, Line 15
double w) Line 16
{ Line 17
height = h; Line 18
width = w; Line 19
} Line 20
public double CalcValue( ) Line 21
{ int xValue = 2; Line 22
xValue += h * w; Line 23
return xValue; Line 24
} Line 25
Using the definition of Door, if you were in the class that has Main( ) and had instantiated an object named panel of the Door class and wanted to send as an argument to the Write( ) method it’s height, you would type Write(“Height = {0}“ , _______________);
Question 3: Normally, as it relates to access mode, we usually specific Blank 1 access for data members, Blank 2 access for methods, Blank 3 access for constructors Blank 4 access with properties and Blank 5 access for classes for object-oriented solutions.
Question 4:
Which of the following would be a valid call to the default constructor for the StaffMember class?
public class StaffMember {
StaffMember employee1 = new StaffMember( );
StaffMember employee1 = new staff( );
StaffMember employee1;
StaffMember employee1 = new StaffMember(default);
Not enough information is given to be able to answer
Question 5:
Which of the following would be the most appropriate way to invoke the CalculateAvg( ) method found in the Student class if an object named gradStudent had been instantiated from the class?
public double CalculateAvg( )
gradStudent = CalculateAvg( );
answer = Student.CalculateAvg( );
CalculateAvg( );
answer = gradStudent.CalculateAvg( );
answer = gradStudent.CalculateAvg(87.2, 90);
propertyName
nameProperty
getName
name
Name
Explanation / Answer
If you post more thn 1 question, as per chegg guidelines I hvae to solve only 1 question.
Ques 4. Answer : (a) StaffMember employee1 = new StaffMember( );
There is no arguments passed in the above statement. Hence, the call would be to default constructor. The name of the class is also correct.
In
StaffMember employee1 = new staff( );
The name of the class after the new operator is not correct.
In
StaffMember employee1 = new StaffMember(default);
an argument is passed, so the call is not to default constructor.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.