114 uint32_t int_length = 0;
115 uint32_t int_width = 0;
116 uint32_t int_base = 0;
117 uint32_t int_height = 0;
118 uint32_t int_depth = 0;
120 double double_radius = NAN;
121 double double_height = NAN;
124 uint32_t int_expected = 0;
125 uint32_t int_volume = 0;
127 double double_expected = NAN;
128 double double_volume = NAN;
135 std::cout <<
"VOLUME OF A CUBE" << std::endl;
136 std::cout <<
"Input Length: " << int_length << std::endl;
137 std::cout <<
"Expected Output: " << int_expected << std::endl;
138 std::cout <<
"Output: " << int_volume << std::endl;
139 assert(int_volume == int_expected);
140 std::cout <<
"TEST PASSED" << std::endl << std::endl;
149 std::cout <<
"VOLUME OF A RECTANGULAR PRISM" << std::endl;
150 std::cout <<
"Input Length: " << int_length << std::endl;
151 std::cout <<
"Input Width: " << int_width << std::endl;
152 std::cout <<
"Input Height: " << int_height << std::endl;
153 std::cout <<
"Expected Output: " << int_expected << std::endl;
154 std::cout <<
"Output: " << int_volume << std::endl;
155 assert(int_volume == int_expected);
156 std::cout <<
"TEST PASSED" << std::endl << std::endl;
161 double_expected = 183.16666666666666;
164 std::cout <<
"VOLUME OF A CONE" << std::endl;
165 std::cout <<
"Input Radius: " << double_radius << std::endl;
166 std::cout <<
"Input Height: " << double_height << std::endl;
167 std::cout <<
"Expected Output: " << double_expected << std::endl;
168 std::cout <<
"Output: " << double_volume << std::endl;
169 assert(double_volume == double_expected);
170 std::cout <<
"TEST PASSED" << std::endl << std::endl;
179 std::cout <<
"VOLUME OF A TRIANGULAR PRISM" << std::endl;
180 std::cout <<
"Input Base: " << int_base << std::endl;
181 std::cout <<
"Input Height: " << int_height << std::endl;
182 std::cout <<
"Input Depth: " << int_depth << std::endl;
183 std::cout <<
"Expected Output: " << int_expected << std::endl;
184 std::cout <<
"Output: " << int_volume << std::endl;
185 assert(int_volume == int_expected);
186 std::cout <<
"TEST PASSED" << std::endl << std::endl;
195 std::cout <<
"VOLUME OF A PYRAMID" << std::endl;
196 std::cout <<
"Input Length: " << int_length << std::endl;
197 std::cout <<
"Input Width: " << int_width << std::endl;
198 std::cout <<
"Input Height: " << int_height << std::endl;
199 std::cout <<
"Expected Output: " << int_expected << std::endl;
200 std::cout <<
"Output: " << int_volume << std::endl;
201 assert(int_volume == int_expected);
202 std::cout <<
"TEST PASSED" << std::endl << std::endl;
206 double_expected = 113.04;
209 std::cout <<
"VOLUME OF A SPHERE" << std::endl;
210 std::cout <<
"Input Radius: " << double_radius << std::endl;
211 std::cout <<
"Expected Output: " << double_expected << std::endl;
212 std::cout <<
"Output: " << double_volume << std::endl;
213 assert(double_volume == double_expected);
214 std::cout <<
"TEST PASSED" << std::endl << std::endl;
219 double_expected = 157;
222 std::cout <<
"VOLUME OF A CYLINDER" << std::endl;
223 std::cout <<
"Input Radius: " << double_radius << std::endl;
224 std::cout <<
"Input Height: " << double_height << std::endl;
225 std::cout <<
"Expected Output: " << double_expected << std::endl;
226 std::cout <<
"Output: " << double_volume << std::endl;
227 assert(double_volume == double_expected);
228 std::cout <<
"TEST PASSED" << std::endl << std::endl;