-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSwimmingPool.cpp
executable file
·79 lines (50 loc) · 1.63 KB
/
SwimmingPool.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// Calculating the volume of a swimming pool.
#include "stdafx.h"
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
cout << fixed << showpoint << setprecision(2);
double length, width, depth, volume, water, cost;
cout << "Please enter the dimensions of the pool you want built, and our automated" << endl << "program will perform the calculations of the size of the pool," << endl << "the water needed, and, the cost of the water required." << endl;
cout << endl;
cout << "Enter length (in feet):" << endl;
cin >> length;
cout << endl;
cout << "Enter width (in feet):" << endl;
cin >> width;
cout << endl;
cout << "Enter depth (in feet):" << endl;
cin >> depth;
cout << endl;
cout << "***Invoice*** September 7, 2016" << endl;
cout << endl;
volume = length * width * depth;
cout << "The volume of the pool shall be:" << endl;
cout << volume << " ""cubic feet" << endl;
cout << endl;
water = volume - (length * width * 0.25);
cout << "The amount of water needed is:" << endl;
cout << water << " ""cubic feet" << endl;
cout << endl;
if (water > 0)
{
cost = (water*0.77) + 100;
cout << "The cost comes out to:" << endl;
cout << cost << " " "U.S. Dollars" << endl;
}
else if (water < 1)
{
cost = 0;
cout << "None";
}
cout << endl;
cout << "Thank you for chooing Smarter Homes INC. for your pool designs," << endl << "please press the <Enter> key to proceed." << endl;
cout << endl;
cout << "Programmed by: Pedro Damian Sanchez Jr" << endl;
cout << endl;
fflush(stdin);
cin.get();
return 0;
}