Question: Could u write me a program in python with these requiremets instrutions Prompt the user for input Velocity as a % of the and
Could u write me a program in python with these requiremets instrutions
Prompt the user for input "Velocity as a of the
and accept the input as a float.
NOTE: Your program will need to do some middle
school math with the input. Basically, you are going to
get something like entered, but that means
of the speed of light equals velocity!
Prompt the user for the mass of the spaceship and accept the
input as a float.
Output the traveling mass of the spaceship.
Output the times in light years that the astronauts
experience as they travel to the following:
Alpha Centauri which is light years away;
Barnard's Star which is light years away;
Betelgeuse which is light years away; and
The Andromeda Galaxy which is light
years away
All output should have decimal place precision.
Constraints:
You must have at least one subroutine;
Your output must be exactly the same as the output of the
sample runs shown below for the specified user input;
You must comment your source code appropriately, include
an informative header at the top, and use good coding style;
You must use meaningful variable names;
When displaying output, use the string format function
with string format specifiers.
Deliverable:
Turn in the Python file py that has your code.
Hint:
There is a square root function in the Math library or you could
remember what means.
Sample Output
Here is some sample output of various runs of a correct solution.
Note that values in bold red are those entered by the user:
Velocity as a of the speed of light:
Mass of the spaceship at rest kg:
Mass of spaceship: kg
Time to travel to Alpha Centauri:
light years
Time to travel to Barnard's Star:
light years
Time to travel to Betelgeuse: light
years
Time to travel to Andromeda Galaxy:
light years
Velocity as a of the speed of light:
Mace nf tho cnarochin at roct kernnnn
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
