Question: Some background information: v = velocity, t = total time, (delta t) timestep = increment, c = drag coefficient, p = air density, A =

Some background information:

Some background information: v = velocity, t = total time, (delta t)

v = velocity, t = total time, (delta t) timestep = increment, c = drag coefficient, p = air density, A = cross-sectional area, m = mass

Your program should ask you to enter in the mass, cross-sectional area, and drag coefficient of the skydiver. Your program should also ask how long do you want to calculate the dive out to and what your timestep (t) will be. You can assume the density of air is 1.14 kg/m3 and gravitational acceleration is 9.81 m/s.

As your program does its calculations, it should save the time and velocities in an array (i.e., in two separate one-dimensional arrays, one for time and the other for velocities). Once you have calculated all these values, write the output to a file. The file should have two columns, the first being the time (t) and the second being the velocity (v(t)) at that time. You can separate the two columns either by a space, tab, or comma; Excel can import files whose columns are separated by any of those characters. Your program, then, should also prompt you for the output filename. (If youre not sure how to use Excel to create a graph, do a Google search or see the Miscellaneous Computing page in the Pages section on the course web site. Importing a delimited text file into Excel usually means opening Excel and then choosing Open from the File menu. Excel should detect what kind of file it is and try to parse it into a spreadsheet grid format. While the full output will go to a file, you should write out a few values to screen so you can see how youre doing. Below is example console output:

Enter the mass of the skydiver (kg): 80 Enter the cross-sectional area of the skydiver (m2): 1.035 Enter the drag coefficient of the skydiver: 0.581 Enter the ending time (sec): 16 Enter the time step (sec): 0.1 Enter the output filename: data.csv Writing out file. Here are the first few lines: 0.100, 0.981 0.200, 1.9616 0.300, 2.9409 0.400, 3.9182 0.500, 4.89270.600, 5.8634 0.700, 6.8297 0.800, 7.7907 0.900, 8.7457 Enter another dive? (y/[n]): n

The private data (attributes) of any class should only be the data directly associated with being that kind of object. Thus, the private attributes of Skydiver should only be the data associated with being a skydiver. Any other variables that help in performing the tasks (i.e., the methods) should be local (i.e., defined within the method). Also, dont forget to write accessor, mutator, and constructor methods, as appropriate. Finally, there should be at least one method that you write that can be used to provide output for tracing variables: The method should be called test-something, e.g., testStatistics. Somewhere in your program, there should be a call to that method. In the code you submit, that call should be commented out, but I should be able to find it. (If youre curious: This doesnt contribute to your grade, but try one case where t is quite a bit larger (and all the other parameters are the same), say t = 5 sec. What happens to your solution? Does this make physical sense? Any thoughts on why this occurs? One hint: What you see is a classic example of what in scientific computing is called numerical instability.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!