This is solved assignment of programming logic course. If you are looking for assistance in programming logic, you can contact us at rakesh@xamnation.com
Programming logic and design problem
You have been asked by a science museum to create an application that displays information about planets to visitors. When users select a planet, they should be able to read information about the selected planet.
Create an application that displays the following menu:
Select a Planet
- Mercury
- Venus
- Earth
- Mars
- Exit the program
Enter your selection.
When the user selects a planet from the menu, the program should display data about the planet’s average distance from the sun, the planet’s mass, and the planet’s surface temperature. Use the following data in your program:
· Mercury
o Average distance from the sun o Mass o Surface temperature · Venus o Average distance from the sun o Mass o Surface temperature · Earth o Average distance from the sun o Mass o Surface temperature · Mars o Average distance from the sun o Mass o Surface temperature |
·
o 57.9 million kilometers o 3.31 × 10^23 kg o –173 to 430 degrees Celsius · o 108.2 million kilometers o 4.87 × 10^24 kg o 472 degrees Celsius · o 149.6 million kilometers o 5.967 × 10^24 kg o –50 to 50 degrees Celsius · o 227.9 million kilometers o 0.6424 × 10^24 kg o –140 to 20 degrees Celsius |
To do
- Create pseudo-code for the program
- Create flowchart for the program
Solution of programming logic and design
Module main()
Declare Integer menuSelection
Do
Call display (menuSelection)
Select menuSelection
Case 1:
Call mercuryDetails()
Case 2:
Call venusDetails()
Case 3:
Call earthDetails()
Case 4:
Call marsDetails()
End Select
While menuSelection!=5
End module
Module displayMenu (Integer Ref selection)
Display "1. Mercury"
Display "2. Venus"
Display "3. Earth"
Display "4. Mars"
Display "5. Exit the program"
Display
Display "Select a Planet"
Input Selection
While selection < 1 OR selection > 5
Display "That is an invalid selection ", "Enter 1,2,3,4,5"
Input menuSelection
End While
End Module
Module mercuryDetails()
Display "Average distance from sun = 57.9 millions kilometers "
Display "Mass = 3.31 x 10^23 kilograms "
Display "Surface temperature = -173 to 430 degree Celcius "
End Module
Module venusDetails()
Display "Average distance from sun = 108.2 millions kilometers "
Display "Mass = 4.87 x 10^24 kilograms "
Display "Surface temperature = 472 degree Celcius "
End Module
Module earthDetails()
Display "Average distance from sun = 149.6 millions kilometers "
Display "Mass = 5.967 x 10^24 kilograms "
Display "Surface temperature = -50 to 50 degree Celcius "
End Module
Module matsDetails()
Display "Average distance from sun = 227.9 millions kilometers "
Display "Mass = 0.6424 x 10^24 kilograms "
Display "Surface temperature = -140 to 20 degree Celcius "
End Module
End Note
We, at Xamnation, are helping students in their assignment and project work for IT courses. Students can get online tutoring, personal mentorship and project help from us. Learn how to create pseudocode, flowchart and write computer programs. Email us your assignment to info@xamnation.com and we will gladly help you.