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 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236
|
#include <iostream>
using namespace std;
int main()
{
double i, o, k, l, r, s, n, m, q, X, Y, Z, H, J, P, B, G, A, C, U, XX, XXX, YY, YYY, AA, CC, SA, SSA, SAA, SSAA, SSSAA, SSSAAA, V, VO, VVO, VVOO, VVVOO;
cout << "1) Area and the volume of a cuboid"<<endl;
cout << "2) Area and the volume of a cube"<<endl;
cout << "3) Area and the volume of a sphere"<<endl;
cout << "4) Area and the volume of a cylinder"<<endl;
cout << "5) Area and the volume of a cone"<<endl;
cin >> i;
if (i = 1)
{
cout << "1) Calculate the area."<<endl;
cout << "2) Calculate the volume."<<endl;
cin >> o;
}
if (o = 1)
{
cout << "Insert the value of side A";
cin >> X;
cout << "Insert the value of side B";
cin >> Y;
cout << "Insert the value of side C";
cin >> Z;
SA = 2 * ((X * Y) + (Y * Z) + (Z * X));
cout <<"The surface area is: "<<SA;
}
if (o = 2)
{
cout << "Insert the value of side A";
cin >> H;
cout << "Insert the value of side B";
cin >> J;
cout << "Insert the value of side C";
cin >> P;
V = H * J * P;
cout <<"The volume is: "<<V;
}
if (i = 2)
{
cout << "1) Calculate the area."<<endl;
cout << "2) Calculate the volume."<<endl;
cin >> k;
}
if (k = 1)
{
cout << "Insert the value of side A"<<endl;
cin >> B;
SSA = 6*B*B;
cout <<"The surface area is: "<<SSA;
}
if (k = 2)
{
cout << "Insert the value of side A"<<endl;
cin >> G;
VO = G*G*G;
cout << "The volume is; "<<VO;
}
if (i = 3)
{
cout << "1) Calculate the area."<<endl;
cout << "2) Calculate the volume."<<endl;
cin >> l;
}
if (l = 1)
{
cout << "Insert the radius of the sphere"<<endl;
cin >> r;
SSAA = 4*3.14*r*r;
cout << "The area of the sphere is: "<<SSAA;
}
if (l = 2)
{
cout << "Insert the radius of the sphere"<<endl;
cin >> U;
VVO = (4*3.14*U*U*U)/3;
cout << "The volume of the sphere is; "<<V;
}
if (i = 4)
{
cout << "1) Calculate the area."<<endl;
cout << "2) Calculate the volume."<<endl;
cin >> n;
}
if (n = 1)
{
cout << "Insert the radius of the cylinder."<<endl;
cin >> A;
cout << "Insert the height of the cylinder."<<endl;
cin >> C;
SSSAA = 2 * (3.14 * A * A) + 2 * (3.14 * A * C);
cout << "The surface area of the cylinder is; "<<SSSAA;
}
if (n = 2)
{
cout << "Insert the radius of the cylinder."<<endl;
cin >> AA;
cout << "Insert the height of the cylinder."<<endl;
cin >> CC;
VVOO = (3.14 * AA * AA * CC);
cout << "The volume of the cylinder is; "<<VVOO;
}
if (i = 5)
{
cout << "1) Calculate the area."<<endl;
cout << "2) Calculate the volume."<<endl;
cin >> m;
}
if (q = 1)
{
cout << "Insert the length of the side"<<endl;
cin >> XX;
cout << "Insert the length of the radius"<<endl;
cin >> YY;
SSSAAA = (3.14 * YY * XX) + (3.14 * YY * YY);
cout << "The surface area of the cone is; "<<SSSAAA;
}
if (q = 2)
{
cout << "Insert the height"<<endl;
cin >> XXX;
cout << "Insert the length of the radius"<<endl;
cin >> YYY;
VVVOO = (3.14 * YYY * YYY * XXX) / 3;
cout << "The volume of the cone is; "<<VVVOO;
}
return 0;
}
|