Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You ll create both pseudocode and a flowchart to design an application that displays the following menu: Select a Planet 1 . Mercury 2 .
Youll create both pseudocode and a flowchart to design 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 the following information about the planet:
Mercury Average distance from the sun million kilometers
Mass times kg
Surface temperature to degrees Celsius
Venus Average distance from the sun million kilometers
Mass times kg
Surface temperature degrees Celsius
Earth Average distance from the sun million kilometers
Mass times kg
Surface temperature to degrees Celsius
Mars Average distance from the sun million kilometers
Mass times kg
Surface temperature to degrees Celsius
Is this correct?
START
main module
Module main
declare a variable to hold the menu selection
DECLARE Integer selection
Do
Display the menu
Call displayMenuselection
Perform the selected operation
Select selection
Case :
DISPLAY "Planet: Mercury
Average distance from sun: million kilometers
Mass: times kg
Surface temperature: to degrees Celsius"
Case :
DISPLAY "Planet: Venus
Average distance from the sun: million kilometers
Mass: times kg
Surface temperature: degrees Celsius
Case :
DISPLAY "Planet: Earth
Average distance from the sun: million kilometers
Mass: times kg
Surface temperature: to degrees Celsius
Case :
DISPLAY "Planet: Mars
Average distance from the sun: million kilometers
Mass: times kg
Surface temperature: to degrees Celsius
Case :
Exit the program
End select
While selection
End Module
The displayMenu module displays the menu, gets and validates the user's selection
Module displayMenuInteger Ref selection
Display the menu.
DISPLAY "Select a planet from the menu & information about the planet will be displayed."
DISPLAY Mercury"
DISPLAY Venus"
DISPLAY Earth"
DISPLAY Mars"
DISPLAY Exit the program"
DISPLAY "Enter your selection."
Get the user' selection.
INPUT selection
Validate the selection.
While selection OR selection
DISPLAY "That is an invalid selection."
DISPLAY "Enter or
INPUT selection
End While
End Module
EXIT
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