Question: 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 2: Write a algorithm and program in C. Let's assume that you could travel to the Moon by car traveling at 100kmh.
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 user-defined functions, one for each
destination. Each of the functions will take the traveling speed in kmh 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: 363,104km. Apogee: 405,696 km
Earth to Mars > Perigee: 54.6 million km. Apogee: 401 million km
Earth to Venus > Perigee: 38 million km. Apogee: 261 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 1,2 or 3. Your
program must keep presenting the menu until the user chooses option 4.
Run your program with the following speeds: 100kmh(car),500kmh(airplane), and
41000kmh(rocket).
 Problem 2: Write a algorithm and program in C. Let's assume

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!