Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1: Which of the following identifiers follows the standard naming convention for naming a class? CalculateFinalGrade MilesPerGallon Train report Employees Question 2: The keyword

Question 1:

Which of the following identifiers follows the standard naming convention for naming a class?

CalculateFinalGrade

MilesPerGallon

Train

report

Employees

Question 2:

The keyword static must be placed on the heading for all instance methods.

True

False

Question 3:

Which of the following is a valid overloaded method for ComputeAmt( )? int ComputeAmt(int val1, int val2)

void ComputeAmt(int val1, int val2)

int ComputeAmt(int val1, int val2)

int ComputeAmt( )

double ComputeAmt(int val1, int val2)

int CalculateAverage(int val2, double val1)

Question 4:

Which of the following is one of the user-defined methods inherited from the object class?

ToString( )

Main( )

ComputeAmt( )

EqualsHashCode( )

TypeHashCode( )

Question 5:

When properties are written as part of the class, including a _________ block within the property definition enables you to change the value of the private data member it is referencing.

Question 6:

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 Fill in the following blanks using the program segment above.

Line_____________defines a default constructor. The return type for the CalcValue ( ) method is___________ . There are___________ formal parameters shown in the program segment above._______________ is a local variable. A property definition heading appears on line_______________ . There are______________ constructors,______________ methods, and________________ instance variables declared in the program segment above. If another property were to be defined, the best name for it would be_____________ . The method does not include a ToString( ) method. If it did, you would include the keyword_______________ as part of the heading to note that a new definition is being provided.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions

Question

Verify the orthogonality of the 2px, 2py, and 2pz functions.

Answered: 1 week ago