Calculate Travel Time To Another Star

Introduction

Light travels at 186,000 miles a second in a vacuum. The sun is about 93 million miles from the earth.

The voyager spacecraft is

Note: An AU (Astronomical Unit) is defined as 92,955,807.3 miles or roughly the average Earth-Sun distance.

Project #0

How far away is voyager now? (In January 2023 the one way light time from voyager was over 22 hours.)

Project #1

Write a program to do the following:

Note: You will need to lookup the distances to different stars. You can find the distances on the web.

Design

  1. The program will ask the user for:
    • Distance to a star (light years)
    • Travel time (years)
  2. The program will output:
    • How far is it to the star (miles)
    • How long Voyager will take to get there (years)
    • How fast would we need to travel to get there in the travel time entered by the user (miles per second)
  3. The program will loop until a "quit" command is entered
    Note: You will have to define what the "quit" command is.
  4. Error messages will be displayed when bad data is entered

Try This

Calculate how far Voyager is from the sun (and earth) in miles, light minutes, light hours, and light years.
Report all of the speeds in furlongs per fortnight and all of the distances in furlongs.
Enter the Star's name and output it along with the calculations.
Enter several stars at one time and create a table of results.

Project #2 (a more challenging problem)

Assume a constant (the same) acceleration and deceleration (like in the "expanse"). How long does it take to get to a Proxima Centauri, (the closest star to our sun).

Generalize the program so the user can enter a star's name, distance, and acceleration/deceleration.

FYI, distance under acceleration or deceleration or coast (when acceleration = 0)
   d = distance
   u = initial velocity
   a = acceleration
   t = time
   d = ut + 1/2(at2)

FYI, The final velocity
   v = final velocity
   d = distance
   u = initial velocity
   a = acceleration
   t = time
   If you have u, a, and t, use v = u + at
   If you have d, u, and t, use v = 2(d/t) − u