Question: CHAPTER 7 ( Using Methods 1 5 . What is a correct declaration for a method that receives two double arguments, calculates and displays the
CHAPTER Using Methods
What is a correct declaration for a method that receives two double arguments, calculates and displays the difference between them, and returns nothing?
a private static void CacDifferencedouble price price
b private static void CalcDifferencedoube price double price
c Both of these are correct.
d None of these are correct.
What is a correct declaration for a method that receives two double arguments and sums them but does not return anything?
a private static void CalcSumdouble firstValue, double secondValue
b private static void CalcSumdouble price doube price
c Both of these are correct.
d None of these are correct.
A method is declared as private static double CalcPay int hoursWorked Suppose you write a Main method in the same class and that it contains the declarations int hours ; and double pay; Which of the following represents a correct way to call the CalcPay method from the Main method?
a hours CalcPay;
c pay CalcPayhourshorkee;
b hours Main.CalcPay;
d pay CalcPayhours;
Suppose the value of IsRateOK is true, and the value of IsQuantityOKO is false When you evaluate the expression IsRateOK II IsQuantityOK which ofthe following is true?
a Only the method IsRateOK executes.
b Only the method IsQuantityOK executes.
c Both methods execute.
d Neither method executes.
Suppose the value of i sRateOK is true, and the value of I sQuantityOK is f l: When you evaluate the expression IsRateOK & IsQuantityOK which of of following is true?
a Only the method IsRateOK executes.
b Only the method IsQuantityOK executes.
c Both methods execute.
d Neither method executes.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
