90 double initial_velocity = 5.0;
94 double expected_time_of_flight = 0.655;
95 double flight_time_output =
99 std::cout <<
"Projectile Flight Time (double)" << std::endl;
100 std::cout <<
"Input Initial Velocity: " << initial_velocity << std::endl;
101 std::cout <<
"Input Angle: " << angle << std::endl;
102 std::cout <<
"Expected Output: " << expected_time_of_flight << std::endl;
103 std::cout <<
"Output: " << flight_time_output << std::endl;
104 assert(flight_time_output == expected_time_of_flight);
105 std::cout <<
"TEST PASSED" << std::endl << std::endl;
108 double expected_horizontal_range = 2.51;
109 double horizontal_range_output =
111 flight_time_output) *
115 std::cout <<
"Projectile Horizontal Range (double)" << std::endl;
116 std::cout <<
"Input Initial Velocity: " << initial_velocity << std::endl;
117 std::cout <<
"Input Angle: " << angle << std::endl;
118 std::cout <<
"Input Time Of Flight: " << flight_time_output << std::endl;
119 std::cout <<
"Expected Output: " << expected_horizontal_range << std::endl;
120 std::cout <<
"Output: " << horizontal_range_output << std::endl;
121 assert(horizontal_range_output == expected_horizontal_range);
122 std::cout <<
"TEST PASSED" << std::endl << std::endl;
125 double expected_max_height = 0.526;
126 double max_height_output =
130 std::cout <<
"Projectile Max Height (double)" << std::endl;
131 std::cout <<
"Input Initial Velocity: " << initial_velocity << std::endl;
132 std::cout <<
"Input Angle: " << angle << std::endl;
133 std::cout <<
"Expected Output: " << expected_max_height << std::endl;
134 std::cout <<
"Output: " << max_height_output << std::endl;
135 assert(max_height_output == expected_max_height);
136 std::cout <<
"TEST PASSED" << std::endl << std::endl;