Perimeter = 2 ( length+width )
Volume = length * width * average depth
Underground surface area = 2 ( length + width ) average depth + length * width
Using these formula as basis, write a program that accepts the length, width and average depth measurements, and then calculates the perimeter, volume and underground surface area of the pool. In writing your program, make the following two calculations immediately after the input data has been entered: length*width and length + width. The results of these two calculations should then be used, as appropriate, l n the assignments statements for determining the perimeter, volume, and underground surface area without recalculation them for each equation. Verify the results of your program by doing a hand calculation using the following test data: length equals 25 feet, width equals 15 feet, and average depth equals 5.5 feet. When you have verified that your program is working, use it to complete the following table.
CODE:
/** Laboratory Exercise #1 CS10-B15
Macanas, Johanna Mari C.
*/
#include<iostream.h>
int main ()
{ float length,width,depth,perimeter,volume,surface_area; //Variable names cout<<"Enter length: "; cin>>length; //Enter length cout<<"Enter width: "; cin>>width; //Enter width cout<<"Enter depth: "; cin>>depth; //Enter depth;
perimeter=2*(length+width); volume=(length*width*depth); surface_area=perimeter*depth+length*width; //Formulas cout<<" "<<endl; //Line break cout<<"Perimeter is: "<<perimeter<<endl; cout<<"Volume is: "<<volume<<endl; cout<<"Underground Surface Area is: