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 7(Using Methods
15. 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 Ca1cDifference(double price1, price2)
b. private static void CalcDifference(doub7e price1, double price2)
c. Both of these are correct.
d. None of these are correct.
16. 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 CalcSum(double firstValue, double secondValue)
b. private static void CalcSum(double price1, doub7e price2)
c. Both of these are correct.
d. None of these are correct.
17. 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 =35; 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 = CalcPay(hourshorkee);
b. hours = Main.CalcPay();
d. pay = CalcPay(hours);
18. 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.
19. 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.
CHAPTER 7 ( Using Methods 1 5 . What is a correct

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!