Exam 6: Modularizing Your Code With Methods

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

The benefit of using methods is known as ____________ because you are writing code to perform a task once and then reusing it each time you need to perform the task.

(Multiple Choice)
4.8/5
(35)

____________ are useful for establishing two-way communication between methods.

(Multiple Choice)
4.9/5
(30)

A method definition has two parts: a header and a body.

(True/False)
4.9/5
(36)

Dividing a large problem into several smaller problems that are easily solved is sometimes called ____________.

(Multiple Choice)
4.7/5
(29)

void methods are useful for simplifying complex conditions that are tested in decision and repetition structures.

(True/False)
4.9/5
(36)

Nested if statements can be useful for modularizing input validation.

(True/False)
4.8/5
(35)

Methods usually belong to a class, so you must write a method's definition inside the class to which it is supposed to belong.

(True/False)
4.8/5
(36)

When an argument is ____________, only a copy of the argument's value is passed into the parameter variable.

(Multiple Choice)
4.9/5
(39)

The method header is always terminated with a semicolon.

(True/False)
4.8/5
(35)

In C#, you declare a reference parameter by writing the ____________ keyword before the parameter variable's data type.

(Multiple Choice)
4.7/5
(38)

The ____________, which appears at the beginning of a method definition, lists several important things about the method, including the method's name.

(Multiple Choice)
5.0/5
(42)

A method that has an output parameter must set the output parameter to some value before it finishes executing.

(True/False)
4.9/5
(36)

When a ____________ finishes, it returns a value to the statement that called it.

(Multiple Choice)
4.9/5
(34)

The value that is returned from a method can be used like any other value.

(True/False)
4.9/5
(36)

When you call a method that has a reference parameter, you must also write the keyword ref before the argument.

(True/False)
4.7/5
(31)

The statements that make up the method body are enclosed inside a set of curly braces.

(True/False)
4.7/5
(40)

When working with value-returning methods, the data type of the value that the method returns is commonly called the method's ____________.

(Multiple Choice)
4.9/5
(37)

In C#, you declare an output parameter by writing the ____________ keyword before the parameter variable's data type.

(Multiple Choice)
4.9/5
(40)

A value-returning statement must have a(n) ____________ statement.

(Multiple Choice)
4.8/5
(37)

You have to write the data type for each parameter variable that is declared in a parameter list.

(True/False)
4.9/5
(39)
Showing 41 - 60 of 61
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)