-
Notifications
You must be signed in to change notification settings - Fork 0
/
29 Easier waycpp.cpp
42 lines (34 loc) · 1.3 KB
/
29 Easier waycpp.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
// Easier way of doing Q29
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
double ordered_mixture_in_cubic_yards, thickness_in_inches, length_ratio, width_ratio;
double ordered_mixture_in_cubic_feet, thickness_in_feets, x, length, width;
cout << "Please entered the amount of concrete ordered in cubic yards: ";
cin >> ordered_mixture_in_cubic_yards;
ordered_mixture_in_cubic_feet = ordered_mixture_in_cubic_yards * 27;
cout << "Concrete ordered in cubic feets: ";
cout << ordered_mixture_in_cubic_feet << endl;
cout << "Please enter the thickness of the patio in inches:";
cin >> thickness_in_inches;
thickness_in_feets = thickness_in_inches / 12;
cout << "Thickness in feets: " << thickness_in_feets << endl;
cout << "Enter the ratio of the length: ";
cin >> length_ratio;
cout << "Enter the ratio of the width: ";
cin >> width_ratio;
cout << "Length : Width = " << length_ratio << " : " << width_ratio << endl;
x = length_ratio / width_ratio;
width = (ordered_mixture_in_cubic_feet * width_ratio) / length_ratio * thickness_in_feets;
length = ordered_mixture_in_cubic_feet / (width * thickness_in_feets);
cout << "Length: ";
cout << length;
cout << endl;
cout << "width: ";
cout << width;
cout << endl;
system("pause");
return 0;
}