Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Description In your program, you will have the user enter what percentage improvement in rocket speeds (up to but not exceeding light speed) each year.

image text in transcribed
image text in transcribed
Description In your program, you will have the user enter what percentage improvement in rocket speeds (up to but not exceeding light speed) each year. Your program will then ask the user the maximum number of years that they are willing to wait on earth before they leave. Use while loops in this step to implement simple error checking by asking the user repeatedly until they give a valid input. Percentage must be somewhere between 0 and 100 and the years waiting must be a positive integer Next, your program will generate a table using a for loop. That table will have four columns with one row for leaving immediately followed by one row for each year the user is willing to wait. The first column will contain the departure year The second column contains the rocket speed that rockets will be able to achieve that year. The new rocket speed each year is calculated with this equation: improvement velocity = velocity + (lightspeed-velocity) * The third column will contain what year it will be on Earth when you arrive on the distant planet if you were to leave at the start of the current year. The last column has the perceived year that you will arrive on the distant planet using the Lorentz factor that takes into account the fact that, since it was traveling so quickly, less time has passed on the rocket. While making these calculations, be sure to keep in mind that the Lorentz equation you implemented in assignment one uses km/s while this program outputs times in years. All columns besides the first should display to two decimal aces Finally, you will need to output a message letting the user know what year they should leave in to arrive on the distant planet as early as possible. This message also lets the user know what time they will arrive as well as what time it will be on earth when they arrive. In order to accomplish this you will need to extend the table generating code so that it also stores and updates variables to keep track of smallest (soonest) perceived year and its associated departure year

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

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions