Calculates the program for determining the distance of a storm, if time between a thunder and a lighting is preset
Delphi & Pascal (česká wiki)
Category: Homework in Pascal
Program: Burka.pas
File exe: Burka.exe
File ubuntu: Burka
flow: Burka.gif
Program: Burka.pas
File exe: Burka.exe
File ubuntu: Burka
flow: Burka.gif
Calculates the program for determining the distance of a storm, if time between a thunder and a lighting is preset. Mathematical reasoning can be found at the beginning of the program.
{ BURKA.PAS Copyright (c) TrSek alias Zdeno Sekerak } { Zostavte program pre urcenie vzdialenosti burky, } { ak doba medzi bleskom a hromom je dana } { } { Datum:04.02.2004 http://www.trsek.com } { Analyza riesenia zvuk = v1 * t1 |----> svetlo = v2 * t2 |------------> vzdialenost s |---------------------------------| t = t1 - t2 -> t1 = t + t2 s = v1 * t1 s = v2 * t2 v2 * t2 = v1 * t1 v2 * t2 = v1 * (t + t2) v2 * t2 = v1 * t + v1 * t2 v2 * t2 - v1 * t2 = v1 * t t2 * (v2-v1) = v1 * t t2 = v1 * t / (v2-v1) s = v2 * t2 s = (v2 * v1 * t)/(v2 - v1) kedze v1 je neporovnatelne mensie ako v2 mozeme ho zanedbat preto: s = (v2 * v1 * t)/v2 s = v1 * t } program burka; uses crt; const v_svetla = 300000; v_zvuku = 340; var doba:real; dlz:real; begin ClrScr; Write('Zadaj dobu medzi bleskom a hromom [s]:'); ReadLn( doba ); dlz := doba * v_zvuku; WriteLn('Vzdialenost burky je ', dlz:8:3,' m.'); ReadLn; end.