Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. How long does it take to get from Earth to Mars? The answer is “it depends”. On what, you ask? Well, to keep things simple, we’ll consider the simplest distance formula: Distance=Rate ×Time
  2.  
  3. In other words, the time it takes to get somewhere depends on how far we need to go and how fast we travel getting there. So how far away is Mars anyway? And how fast can we travel?
  4.  
  5. Mars is the fourth planet from the sun, and the second closest to Earth (Venus is the closest). But the distance between the two planets is constantly changing as they travel around the sun. In theory, the closest that Earth and Mars would approach each other would be when Mars is at its closest point to the sun (perihelion) and Earth is at its farthest (aphelion). This would put the planets only 33.9 million miles apart. However, this has never happened in recorded history. The closest approach of the two planets occurred in 2003, when they were only 34.8 million miles apart. The two planets are farthest apart when they are both at their farthest from the sun, on opposite sides of the star. At this point, they can be 250 million miles apart.
  6.  
  7. The fastest spacecraft launched from Earth was NASA's New Horizons mission, which is en route to Pluto. In January 2006, the probe left Earth at 36,000 miles per hour.
  8.  
  9. Program Input:
  10.  
  11. The first line of the file mars.in.txt will contain a positive integer T denoting the number of test cases that follow. Each test case will have the following input:
  12.  
  13. A single line containing two numbers separated by a space. The numbers will be as follows:
  14. The first number will be the distance between Mars and Earth, measured in millions of miles. The number could be an integer or a decimal.
  15. The second number will be the speed of the ship, measured in miles per hour. The number could be an integer or a decimal.
  16.  
  17. Program Output
  18. Your program should print out how long it will take the ship to reach Mars in the following format:
  19.  
  20. Time to Mars: <DAYS> days, <HOURS> hours, <MINUTES> minutes, <SECONDS> seconds
  21.  
  22. Example Output:
  23.  
  24. Time to Mars: 40 days, 6 hours, 40 minutes, 0 seconds
  25. Time to Mars: 289 days, 8 hours, 25 minutes, 31 seconds
  26. Time to Mars: 265 days, 22 hours, 58 minutes, 43 seconds
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement