# purpose: calculate time dilation and mass increase as speed increases # pre-condition: velocity as percent of speed of light, 0 to 100 # post-condition: mass of ship, distance to travel to 4 stars # import sqrt function for factor equation # print title and blank line # ask for velocity as percent of speed of light # check for negative velocity # tell user and use 0.01% as value # check for velocity 100% or more # tell user and use 99% as value # convert input to percent by dividing by 100 # calculate factor # calculate weight of space ship multiplying by factor # starting weight 70000.0 kg # calculate perceived time taken to each of 4 stars, divide by factor # Alpha Centauri 4.3 years # Barnard's star 6.0 years # Betegeuse 309.0 years # Andromeda Galaxy 2000000 (2 million) years # display results, round to 6 places