<%@ Page Title="" Language="C#" MasterPageFile="~/Default.master" AutoEventWireup="true" CodeBehind="Q015.aspx.cs" Inherits="ON7AMI_2012.BookShelf.Physics.SolutionsPhysicsForEngeneersAndScientistsInternational.Chapter_02.Q015" %> Chapter-2 Q015 - Physics For Engineers And Scientists - Solutions

Question 15 - Problems - Chapter 2

Problem:

The distance from New York to Belem, Brazil, is 5280 km.

Question:

a) How long does it take you to travel this distance by airliner, at 900 km/h?

b) How long does it take you by ship, at 35 km/h?

Solution:

Distance $s = 5280$ km

Speed $v = 900$ km/h

Time $t = \frac{s}{t}$

In [1]:
from datetime import timedelta
from datetime import datetime
dts = datetime(2000,1,1,0,0,0,0)
Distance = 5280 # in km
Speed = 900 # in km/h
Time = Distance / Speed
tm = timedelta(hours=Time)
dt = dts + tm
print(f'The time to fly is {Time:.3f} h. or ' + dt.strftime('%Hh %Mm %Ss'))
Speed = 35 # in km/h
Time = Distance / Speed
tm = timedelta(hours=Time)
dt = dts + tm
print(f'The time by boat is {Time:.3f} h. or ' + dt.strftime('%d days %Hh %Mm %Ss'))
The time to fly is 5.867 h. or 05h 52m 00s
The time by boat is 150.857 h. or 07 days 06h 51m 25s