Exoplanets are planets outside of our solar system. So far, approximately 4800 exoplanets have been discovered. Whilst a few "lone wolf" planets have been discovered, most of the exoplanets are associated with one of approximately 3500 stars, with approximately 800 stars associated with more than one discovered exoplanet.
The vast majority of discovered exoplanets have been discovered when the they transit across our line of sight to the star that they orbit, but some have been discovered by dopler spectography and others have been imaged: see image.
It follows that larger planets are more likely to be discovered than small planets, and planets close to the star that they orbit are also more likely to be discovered than far out planets.
Planet habitability is a measure of a planet's potential to develop and maintain environments hospitable to life. The discovery of exoplanets is ongoing.
Your task is write a program that will:-
1. Collect information from the user about discovered exoplanets.
2. Perform some calculations.
3. Display some results, including a summary of collected data in the form of a HTML table.
Your program will then perform some calculations and then display the results in the form of a HTML table.
Your program has 3 phases, as shown in the diagram above:-
Your program must allow the user to keep entering the detail for another exoplanet until such time as the user no longer wishes to. How you achieve that is up to you, but it must be easy to use and you need to make sure the user knows what to do.
You must perform interactive input by using the prompt() function (and possibly the confirm() function). Full validation of all input is required:-
For each exoplanet that the user chooses to enter, you need to get the following from the user:-
1) The name of the exoplanet. The name of the exoplanet cannot be the empty string.
2) The year of discovery of the exoplanet. The year must be an integer greater than 1900 and less than 2022.
3) The method of discovery of the exoplanet. The method of discovery of the planet must be one of the following:-
transit
doppler
imaged
other
4) The name of the star that the exoplanet belongs to. It can be any string aside from the empty string.
5) The mass of the planet. The mass of the planet is in Mj (Jupiter Masses). This is a number greater than zero and less than 100.
The calculation phase begins when the input stage is finished, and the display phase happens when the calculations have been performed. Please do not let the phases bleed into each other. Your marker wants to see these parts of your code separately. Your program must calculate the following collective data regarding the entered exoplanets (in no particular order):-
You program must write HTML to the document including a single table with all of the inputted information for each exoplanet entered.
If there are no planets then this must be stated.
Otherwise you must output the following:-