MIST Unit 8 Quiz

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

requires an argument to be sent from a method call

A mandatory parameter ______________________.

both of these are true: can accept any number of arguments of the same data type & is declared using the keyword params

A parameter array ______________________.

requires an initial value

A reference parameter differs from an output parameter in that a reference parameter ______________________ but an output parameter does not.

100

Assume that you declare a variable as int x = 100; and correctly pass it to a method with the declaration private static void IncreaseValue(int x). There is a single statement within the IncreaseValue() method: x = x + 25;. Back in the Main() method, after the method call, what is the value of x?

125

Assume that you declare a variable as int x = 100; and correctly pass it to a method with the declaration private static void IncreaseValue(ref int x). There is a single statement within the IncreaseValue() method: x = x + 25;. Back in the Main() method, after the method call, what is the value of x?

All of these are valid: DisplayScores(20, 33); DisplayScores(20, 30, 90); DisplayScores(20);

Assume that you have declared a method with the following header: private static void DisplayScores(params int[] scores) Which of the following method calls is valid?

CalculateDiscount();

Assume you have declared a method as follows: private static double CalculateDiscount(int acct = 0, double price = 0, double discount = 0) Which of the following is a legal method call?

ComputeBill(1001, 200.00);

Assume you have declared a method as follows: private static double ComputeBill(int acct, double price, double discount = 0) Which of the following is a legal method call?

All of these are legal: DisplayData(amount : 200, name : "Albert"); DisplayData(amount : 900.00); DisplayData(name : "Albert");

Assume you have declared a method as follows: private static double DisplayData(string name = "XX", double amount = 10.0) Which of the following is an illegal method call?

identifier

Correctly overloaded methods must have the same ______________________.

are indistinguishable to the compiler

Methods are ambiguous when they ______________________.

the program would not compile

Suppose that you have declared an integer array named scores, and you make the following method call: TotalScores(scores, num : 1); Of the following overloaded method definitions, which would execute?

resolution

The process of determining which overloaded version of a method to execute is overload ______________________.

a default value will be assigned to the parameter if no argument is sent for it

When one of a method's parameters is optional, it means that ______________________.

a data type

When you declare a value parameter, you precede its name with ______________________.

forensic

Which is not a type of method parameter in C#?

private static void CreateStatement(int acctNum = 0, double balance)

Which of the following is an illegal method declaration?

Two of these are correctly overloaded methods.

Which of the following pairs of method declarations represent correctly overloaded methods?

private static void Method(double d) private static int Method()

Which of the following pairs of method declarations represent correctly overloaded methods?

two of these

Which type of method parameter receives the address of the variable passed in?


Ensembles d'études connexes

Elements, mixtures and compounds

View Set

Chapter 5: Competitive Advantage, Firm Performance, and Business Models

View Set

Quiz Chapter 11 Process Design and Analysis

View Set

quant methods in business ch. 1-4 study guide

View Set

CH 28 - Care of Patients Requiring Oxygen Therapy or Tracheostomy

View Set

GIS Level 1 Capstone Practice Exam

View Set

IHI: introduction to health care improvement

View Set

Integumentary Disorders (Prep U) Spring '18

View Set