Question: How to solve 17? 1S. Write a method called apherevol ume that accepts a radius as a parameter and returns that radius. For example, the
1S. Write a method called apherevol ume that accepts a radius as a parameter and returns that radius. For example, the call spherevolume (2.0) should return 33.510321 volume of a sphere with radius r is the following volume- 16. Write a method called triangleArea that accepts the three side lengths of a triang with area of a triangle with those side lengths. For example, the call triangleAr 18.151176098258745. To compute the area, use Heron's formula, which states three sides have lengths a, b, and c, is the following. The formula is based on t 10321638291124. The formula for the half the perimeter of the triangle: area = Vs(s-a)(s-b)(s-c) le as 5.2, 7.1) should return that the area of a t the computed value s, a length equal to 17. Write a method called padstring that accepts tw Cen' should pad the parameter string with spaces until its length is the given length. For should return "hello(This sort of method trying to string's length is already at least as long as the length parameter, your method should return o parameters: a string and an integer example, padstring("congratulations, 10) should return "congratulation a length. The method s useful when trying to print output that lines up horizontally) If the Prog string, I I. w ld produce the following out 19. Write a method called printReverse that accepts a string as its parameter and prints the characters in order. For example, a call of printReverset "hello there!) should print tereht olleh the cp string is passed, the method should produce no output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
