Vyom World.com Let's Touch the Sky Together!
 Home VyomWorld.com Home Free Magazines! VyomLinks.com Home JobsAssist.com Home Vyom Network Contact Us Jobs & Careers Resume Submitter Placement Papers IT Companies Directory Computer Jobs Interview Questions Online Exams Vyom Career eMag. Fun Screensavers New! Send FREE SMS! SMS Jokes Source Codes Library Source Codes Home ASP Source Codes C Source Codes C++ Source Codes COBOL Source Codes Java Source Codes Pascal Source Codes Submit Source Codes GATE GATE an Overview GATE Preparation Study Materal GRE GRE an Overview GRE Questions GRE Preparation GRE Universities TOEFL Preparation TOEFL Resources GMAT Preparation GMAT Resources MBA Preparation MBA Resources Networking Concepts Networking Concepts Testing Preparation Testing Resources Webmasters Free Traffic Builder Webmaster Articles Web Hosting Tutorials Hardware Tutorial 1500 Free eBooks New! FREE Publications
Vyom Career eMag.
 Get 9,000+ Interview Questions & Answers in an eBook. 9,000+ Interview Questions All Questions Answered 5 FREE Bonuses Free Upgrades Get it now!
Get 9,000+ Interview Questions with Answers in an eBook

Home >> Source Codes Library Home >> Language Home >> Category Home > > Item Description
Search Code Library

 Title Nautical/Flight Functions Description: The Nautical/Flight functions perform various calculations useful for planning trips. The definitions and arguments of each function is below. miles per hour to knots ----------------------- function name: MPHToKt purpose: converts miles per hour to knots arguments: mph miles per hour as double returns: double knots to miles per hour ----------------------- function name: KtToMPH purpose: converts knots to miles per hour arguments: knots knots as double returns: double miles to nautical miles ----------------------- function name: miToNautMi purpose: converts miles to nautical miles arguments: miles miles as double returns: double nautical miles to miles ----------------------- function name: nautMiToMi purpose: converts nautical miles to miles arguments: nauticalmiles nautical miles as double returns: double flight time in minutes ----------------------- function name: minsInFlight purpose: calculates total flight time in minutes arguments: nauticalmiles nautical miles to travel as double knots air speed in knots as double returns: double nautical miles flown ----------------------- function name: nautMiFlown purpose: calculates the nautical miles flown arguments: knots air speed in knots as double minutes minutes elapsed as double returns: double average speed in knots ----------------------- function name: ktSpeed purpose: calculates the average speed in knots arguments: nauticalmiles nautical miles travelled as double minutes minutes elapsed as double returns: double hours to minutes ----------------------- function name: hrMins purpose: converts hours to minutes arguments: hour hours as double returns: double seconds to minutes ----------------------- function name: sdMins purpose: converts seconds to minutes arguments: seconds seconds as double returns: double gallons of fuel needed ----------------------- function name: galFuel purpose: calculates the minimum number of gallons of fuel needed for a given trip time. arguments: minutes minutes as double gallonsPerHour gallons per hour consumed by craft as double returns: double Hits: 1446 Since 25th November, 2003 Code: Select and Copy the Code 'miles per hour to knots Private Function MPHToKt(ByVal mph) MPHToKt = CDbl(CDbl(mph) / 1.152) End Function 'knots to miles per hour Private Function KtToMPH(ByVal kt) KtToMPH = CDbl(1.152 * CDbl(Kt)) End Function 'miles to nautical miles Private Function miToNautMi(ByVal miles) MiToNautMi = CDbl((CDbl(miles) * 5280) / 6076.1) End Function 'nautical miles to miles Private Function nautMiToMi(ByVal nautMi) NautMiToMi = CDbl((CDbl(nautMi) * 6076.1) / 5280) End Function 'flight time in minutes Private Function minsInFlight(ByVal nautMi, ByVal kt) MinsInFlight = CDbl((CDbl(nautMi) / CDbl(kt)) * 60) End Function 'nautical miles flown Private Function nautMiFlown(ByVal kt, ByVal mins) NautMiFlown = (CDbl(mins) / 60) * CDbl(CDbl(kt)) End Function 'average speed in knots Private Function ktSpeed(ByVal nautMi, ByVal mins) ktSpeed = CDbl(CDbl(nautMi) / (CDbl(mins) / 60)) End Function 'hours to minutes Private Function hrMins(ByVal hr) hrMins = CDbl(CDbl(hr) * 60) End Function 'seconds to minutes Private Function sdMins(ByVal sd) sdMins = CDbl(CDbl(sd) / 60) End Function 'gallons of fuel needed Private Function galFuel(ByVal mins, ByVal gph) galFuel = CDbl((CDbl(mins) / 60) * gph) End Function

ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home