Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 2 : Write a algorithm and program in C . Let's assume that you could travel to the Moon by car traveling at 1
Problem : Write a algorithm and program in C Let's assume that you could travel to the Moon by car traveling at
How long would that take to get there? How about going to Mars or Venus? If you go
there by rocket with a higher speed, it would obviously take less time.
To solve this problem you will need to write three userdefined functions, one for each
destination. Each of the functions will take the traveling speed in as the argument
and give the time in hours it will take to get to the destination.
Note that because there are minimum perigee and maximum apogee distances between
the Earth, the Moon, Mars and Venus, you will need to calculate the minimum and
maximum travel times so the three functions will each produce two results.
Distances:
Earth to Moon Perigee: Apogee: km
Earth to Mars Perigee: million km Apogee: million km
Earth to Venus Perigee: million km Apogee: million km
Write a C program that will present a menu with four options:
Traveling to the Moon
Traveling to Mars
Traveling to Venus
Exit program.
You will ask the user for the traveling speed after the user has chosen options or Your
program must keep presenting the menu until the user chooses option
Run your program with the following speeds: carairplane and
rocket
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