Question: When one of a method's parameters is optional, it means that a . no arguments are required in a call to the method b .

When one of a method's parameters is optional, it means that
a. no arguments are required in a call to the method
b. a default value will be assigned to the parameter if no argument is sent for it
c. a default value will override any argument value sent to it
d. you are not required to use the parameter within the method body
345
Which of the following is an illegal method declaration?
a. private static void CreateStatement(int acctNum, double balance =0.0)
b. private static void CreateStatement(int acctNum =0, double balance)
c. private static void CreateStatement(int acctNum =0, double balance =0)
d. All of these are legal.
Assume you have declared a method as follows: private static double ComputeBil1(int acct, double price, double discount =0) Which of the following is a legal method call?
a. ComputeBi11();
c. ComputeBi11(1001,200.00);
b. ComputeBil1(1001);
d. None of the above is legal.
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?
a. CalculateDiscount();
b. CalculateDiscount (200.00);
c. CalculateDiscount (3000.00,0.02);
d. None of the above is legal.
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?
a. DisplayData(name : "Albert");
b. DisplayData(amount : 200, name : "Albert");
c. DisplayData(amount : 900.00);
d. All of these are legal.
When one of a method's parameters is optional, it

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!