Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How would this code be formatted in Python 3? I know this question has been answered before but not in the format I need which

How would this code be formatted in Python 3? I know this question has been answered before but not in the format I need which is in Python 3. image text in transcribed

This programming project will use the input and print functions along with some simple mathematics for conversion. The required math is described below. We are going to estimate the length of time that passes for astronauts as they travel at near-light speeds. You may remember that time passes more slowly for the astronauts on ship than those on earth as the ship approaches the speed of light. You may also remember that the mass of the ship also increases as it approaches light speed (which, therefore, is an estimate of how much more energy much be expended as you approach light speed). You may remember that Einstein wrote a simple equation that provides a factor indicating the change in time and mass based on speed, which is: factor = - where vis velocity and c is the velocity of the speed of light, which is well approximated at 299,792,458 meters/second. The factor calculated is how much time is reduced by and how much mass is increased by. For example, at 149,896,229 meters per second (half the speed of light) the factor is 1.1547005383792517. Time's passage is reduced by the factor (division) and the mass is increased (multiplication). Program Specifications Your program will prompt the user for a floating-point number representing the percentage of the speed of light your ship will travel. Your program then prints the following information: The weight of the ship. Assume the ship weighs 70,000 kilograms, the weight of the empty space shuttle orbiter, when at rest. The times the astronauts experience for trips to: o Alpha Centauri: 4.3 Light Years o Barnard's Star: 6.0 Light Years o Betelgeuse (in the Milky Way): 309 Light Years o Andromeda Galaxy (closest galaxy): 2,000,000 Light Years Your program must use a user-defined function to perform the needed math and return the appropriate factor to use in further calculations; it should have the following header: def einstein_factor(velocity)

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

Step: 3

blur-text-image

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

More Books

Students also viewed these Databases questions

Question

119. If X is uniformly distributed on [1, 1], find the pdf of Y X2.

Answered: 1 week ago