Answered step by step
Verified Expert Solution
Link Copied!

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 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).
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

More Books

Students also viewed these Databases questions

Question

Describe the new business planning process.

Answered: 1 week ago

Question

Write down the circumstances in which you led.

Answered: 1 week ago

Question

How do Data Types perform data validation?

Answered: 1 week ago

Question

How does Referential Integrity work?

Answered: 1 week ago