Question: Consider the method: private void ShowName(string firstName, string lastName) { MessageBox.Show(firstName + + lastName); } Which of the following could be used to call the

  1. Consider the method: private void ShowName(string firstName, string lastName) { MessageBox.Show(firstName + + lastName); } Which of the following could be used to call the method?
  1. ShowName(lastName : Smith, firstName : Suzanne);
  2. ShowName(Suzanne, Smith);
  1. Write a method named showTax which has 2 parameters of type decimal. The first parameter is the price of the items sold. The second parameter is the tax rate which has a default value of 0.07. The method does not return a value. It multiplies the price by the tax rate and displays the result in a message box.
  2. Write a method named swap which will use 2 parameters of type double. It will have the parameters exchange values. For example, if the variables amt1 and amt2 have values 3.5 and 7.9 respectively, then after calling swap(amt1, amt2) the value of amt1 will be 7.9 and amt2 will be 3.5.

Please answer 2 and 3 using C# if you can. Thank you.

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 Databases Questions!