Question
An astronomy application displays information about the eight planets in our solar system. Write the logic for this application in pseudocode: a. Visit this web
An astronomy application displays information about the eight planets in our solar system. Write the logic for this application in pseudocode:
a. Visit this web page: https://sciencing.com/order-planets-distance-sun8371065.html
b. Note down each planets name, distance from the sun, and diameter
c. Write the program such that it:
i. Displays a numbered list of the planets that includes 1. Planet number (1 is the planet closest to the sun and 8 is the one farthest from it) 2. Planets name 3. Distance from the sun 4. Diameter Here is a sample of the required format of output: Planet #1: Mercury is 36 million miles from the sun and has a diameter of 3031 miles
ii. Allows the user to enter the number of any planet, and displays output similar to that shown above, for that planet, e.g., if the user entered 1, the output would be the sentence shown above. If the user enters an invalid planet number, such as zero or 9, the program must display an error message.
iii. Allows the user to enter the numbers of any two planets, and outputs both their names as well as their distance from each other. If the user enters an invalid planet number, such as zero or 9, the program must display an error message.
Note: (ii) and (iii) above must be accomplished without any search being performed
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started