Question: Write a C++ program 1. You may recall from our first Matlab homework that a smooth sphere (maybe a rain drop, or a soccer ball,


Write a C++ program
1. You may recall from our first Matlab homework that a smooth sphere (maybe a rain drop, or a soccer ball, or with diameter D traveling at velocity V through a stationary fluid with density and viscosity will experience a drag force Fa that can be approximately calculated as where A-D2/4 is the cross-sectional area of the sphere and Cd is the so-called "drag coeffi cient". In this homework, let's assume that (this is actually a pretty good approximation) the drag coefficient is given by 24 Cd (1 +0.27Re)0.43 +0.47 [1-exp (-0.04Re038] Re , where Re = is the so-called "Reynolds number" of the flow around this sphere. Write a C++ file drag_coefficient.cpp that contains a main program (of course that is always required) and a function float Cd(float Re) that takes the Reynolds number Re as its input and produces the drag coefficient Cd as its output. You should then write the main part of the program such that it produces the following output Cd Re 1.000e-01 2.428e+02 1.000e+00 2.662e+01 1.000e+01 4.255e+00 1.000e+02 1.102e+00 1.000e+03 4.663e-01 1.000e+04 4.168e-01 1.000e+05 4.697e-01 Hint: To get this formatted output, remember to #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
