1. 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(double,double) a. gradStudent = CalculateAvg(87.2, 90); b. answer = Student.CalculateAvg(87.2, 90); c. CalculateAvg(87.2, 90); d. answer = gradStudent.CalculateAvg(double, double); e. answer = gradStudent.CalculateAvg(87.2, 90); 6. Which of the following is one of the user-defined methods inherited from the object class?
a. ToString( )
b. Main( )
c. CalculateAvg( )
d. EqualsHashCode( )
e. TypeHashCode( )
2. Properties are associated with the of the class while methods are affiliated with the of the class.
a. activity, fields
b. accessors, mutators
c. objects, instances
d. data, behavior
e. behavior, data
3. Which of the following is a valid overloaded method for CalculateAvg( )? int CalculateAvg(int val1, int val2)
a. void CalculateAvg(int val1, int val2)
b. int CalculateAvg(int val1, int val2)
c. int CalculateAvg(double val1, double val2)
d. double CalculateAvg(int val1, int val2)
e. int CalculateAverage(int val2, int val1)

Respuesta :

Limosa

Answer:

The correct answer to the following questions is:

1.) Option e.) answer = gradStudent.CalculateAvg(87.2, 90);

6.) Option a.) ToString( ).

2.) Option d.) data, behavior.

3.) Option c.) int CalculateAvg(double val1, double val2).

Explanation:

There are two types of methods in every programming language.

1. User-defined methods -These methods are those which is defined by the user and these methods where the user wants.

2. Built-in methods - These methods are those which are already defined in these language. Only users can call these methods.

Overloaded method - These functions are those functions which have the same name but different in the argument list.