Question: write a algortim and a Code in C . Problem 2 : Let's assume that you could travel to the Moon by car traveling at
write a algortim and a Code in C Problem : 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:
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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
