Here is an example of the structure of my JSON
file:
{
"PlanetIdentifier": "KOI-1843.03",
"TypeFlag": 0,
"PlanetaryMassJpt": 0.0014,
"RadiusJpt": 0.054,
"PeriodDays": 0.1768913,
"SemiMajorAxisAU": 0.0048,
"Eccentricity": "",
"PeriastronDeg": "",
"LongitudeDeg": "",
"DiscoveryYear": 2012
},
{
"PlanetIdentifier": "KOI-1843.01",
"TypeFlag": 0,
"PlanetaryMassJpt": "",
"RadiusJpt": 0.114,
"PeriodDays": 4.194525,
"SemiMajorAxisAU": 0.039,
"Eccentricity": "",
"PeriastronDeg": "",
"LongitudeDeg": "",
"DiscoveryYear": ""
}
My current task is to arrange the objects by year
and then by RadiusJpt
.
if(RadiusJpt > 2) then it is classified as a large planet
if(RadiusJpt < 1) then it is classified as a small planet
else it is classified as a medium-sized planet
After sorting, I need to display the count of small, medium, and large planets discovered each year.