Question: Programming Tasks: Please Answer this in only Basic C Language! CODE SETUP Create and fill arrays with the data for the 12 planets from each

Programming Tasks: Please Answer this in only Basic C Language!

CODE SETUP

  • Create and fill arrays with the data for the 12 planets from each of the columns in the table. There should be 4 total arrays of size 12 at this point, but you will make more later. You will use all of these arrays in this Project as you categorize the planets.
  • Read in a single integer value from the user, which is the number of planets that the program should include in the remaining calculations and output. For example, if the user enters 6, the program should perform the analysis below for the first 6 planets in the table and produce the sample output shown below.

PLANET RADII IN MILES

  • Make an additional array to hold planet radii in miles for each planet. Fill this array by calculating the radius in miles of each planet using the data in your arrays. Note: the radius of Jupiter is 43441 miles. Then, print out the radii (in miles with no decimal places) for all of the planets in a list (see sample output below).
  • Create a histogram where the planets are binned (i.e. grouped) based on their radii (see sample output below). Do this by counting the number of planets in the data whose radius falls into the specified ranges (Note: the radii of Earth and Jupiter are 3959 and 43441 miles, respectively.):

~Earth - the planet's radius is between half Earth's radius and twice Earth's radius.

>Jupiter - the planet's radius is greater than Jupiter's radius.

PLANET DISTANCES TO STAR

  • Make an additional array to hold planet-distance-to-star values for each planet. Fill this array by calculating the distance from each planet to its star using the data in your arrays. Note: the units for the distance must be Astronomical Units, AU (or the typical distance from the Sun to the Earth, where 1 AU = 215 solar radii). Then, print out the distances (in AU units with 3 decimal places) for all of the planets in a list (see sample output below).
  • Create a histogram where the planets are binned (i.e. grouped) based on their distance to their star (see sample output below). Do this by counting the number of planets in the data whose planet-distance-to-star falls into the specified ranges (Note: the distance from the Sun to Earth and Jupiter are 1.0 AU and 5.2 AU, respectively.):

~Earth - the planet's distance to its star is between 0.5 AU and 2.0 AU

.

>Jupiter - the planet's distance to its star is greater than 5.2 AU.

Sample Output

Here is a complete sample output from the code, where only the first six planets on the list have been included in the investigation

Enter the number of planets to categorize (max 12): 6 Planets: Earth Mars Venus HAT-P-16 K2-29 KELT-4-A Planet radii (in miles): 3959, 2063, 3677, 55995, 51695, 30365 Planets by size: Jupiter: ** Planet distances to their stars (in AU): 1.000, 1.525, 0.720, 0.044, 0.042, 0.043 Planets by distance to their stars: Jupiter: 

The current state-of-the-art methods for finding exoplanets is good at finding very BIG planets that are are very close to their stars, which is not a good combination for the habitability of life. You should see this trend in your histograms.

General Comments & Policies

  • ALL OF YOUR CODE MUST BE IN main(), since user-defined functions are not allowed for this part of the project.
  • Make sure to properly format all output printed to the screen, by closely following the sample output format.
  • There should only be a single user input, which represents how many planets to include in the output (lists and histograms)

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!