next up previous
Next: About this document ...

ESC 251 HW 25 Due: Nov. 8

For each program below, you should write the requested subroutines and a main program to test them.

1)
(2 pts) Write your own version of the triangle subroutine (i.e., take the existing triangle subroutine and change the variable names). Use your own test case.
2)
(2 pts) Write a subroutine that will compute the area of a circle given the radius. Test it for r = 3.2. Use different variable names in your subroutine than you use in the main program.
3)
(2 pts) Write a subroutine that will compute the surface area of a regular cube given the length of a side. Test your routine for s = 14.3. Use different variable names in your subroutine than you use in the main program.
4)
(2 pts) Write a subroutine that will compute the volume of a circular cylinder given the radius and the height. Test your routine for r = 0.34, h = 1.77. Use different variable names in your subroutine than you use in the main program.




2017-11-06