Write a method called average that takes two integers as parameters and returns the average of the two integers. Modify your pow method from Exercise 5 to make a new method called pow2 that uses the...



Write a method called average that takes two integers as parameters and


returns the average of the two integers.



Modify your pow method from Exercise 5 to make a new method called


pow2 that uses the type double for the first parameter and that works


correctly for negative numbers. For example, the call pow2(–4.0, 3)


should return –4.0 * –4.0 * –4.0, or –64.0, and the call pow2(4.0, –


2) should return 1 / 16, or 0.0625.

Nov 14, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here