#!/usr/bin/env python print ("Welcome to Weight and Balance Calculator for C172 by C.Baker") print ("Follow the on screen prompts.") aew = input ("Aircraft empty weight in lbs --> ") aea = input ("ARM --> ") aem = input ("Moment / 1000 --> ") pw = float (input ("Pilot weight in kg --> ")) paw = float (input ("Passenger weight in kg --> ")) rp = float (input ("Rear passengers weight in kg --> ")) la1 = float (input ("Luggage area 1 weight in kg --> ")) la2 = float (input ("Luggage area 2 weight in kg --> ")) fuel = float (input ("Fuel in USG --> ")) fudf = float (input ("Fuel used in flight USG --> ")) #Change these variable for diffrent aircraft #Pilot passenger arm ppa = 37.0 #Rear passenger arm rpa = 73.0 #Luggage area 1 arm la1a = 95.0 #Luggage area 2 arm la2a = 123.0 #Fuel arm fuela = 47.8 #Pilot + passenger weight in lbs ppw = ((float(pw) + float(paw)) * 2.20462) #Rear passenger weight in lbs rpw = (float(rp) * 2.20462) #Luggage area 1 weight in lbs la1w = (float(la1) * 2.20462) #Luggage area 2 weight in lbs la2w = (float(la2) * 2.20462) #Pilot + Passenger moment ppm = ((float(ppw) * float(ppa)) / 1000.0) #Rear passengers moment rpm = ((float(rpw) * float(rpa)) / 1000.0) #Luggage area 1 la1m = ((float(la1w) * float(la1a)) / 1000.0) #Luggage area 2 la2m = ((float(la2w) * float(la2a)) / 1000.0) #Fuel weight in pounds fuelw = (float(fuel) * 6) #Fuel moment fuelm = ((float(fuelw) * float(fuela)) / 1000.0) #Fuel used in flight in pounds fudfw = (float(fudf) * 6) #Used fuel moment fudfm = ((float(fudfw) * float(fuela)) / 1000.0) #Take off weight tow = (float(aew) + float(ppw) + float(rpw) + float(la1w) + float(la2w) + float(fuelw)) #Take off moment tom = (float(aem) + float(ppm) + float(rpm) + float(la1m) + float(la2m) + float(fuelm)) #Take off arm toa = ((float(tom) * 1000.0) / float(tow)) #Landing weight ldw = (float(tow) - fudfw) #Landing moment ldm = (float(tom) - float(fudfm)) #Landing arm lda = ((float(ldm) * 1000.0) / float(ldw)) #Pause input ("Press <Enter>") #data change set aews = str(aew) aeas = str(aea) aems = str(aem) ppws = str(round(ppw)) ppas = str(round(ppa)) ppms = str(round(ppm)) rpws = str(round(rpw)) rpas = str(round(rpa)) rpms = str(round(rpm)) la1ws = str(round(la1w)) la1as = str(round(la1a)) la1ms = str(round(la1m)) la2ws = str(round(la2w)) la2as = str(round(la2a)) la2ms = str(round(la2m)) fuelws = str(round(fuelw)) fuelas = str(round(fuela)) fuelms = str(round(fuelm)) tows = str(round(tow)) toas = str(round(toa)) toms = str(round(tom)) fudfws = str(round(fudfw)) fudfms = str(round(fudfm)) ldws = str(round(ldw)) ldas = str(round(lda)) ldms = str(round(ldm)) #exporting of final data print (" |Weight | ARM | Moment/1000|") print ("Aircraft Empty Wight" + " | " + aews + " | " + aeas + " | " + aems + " | ") print ("Pilot+Front passenge" + " | " + ppws + " | " + ppas + " | " + ppms + " | ") print ("Rear passengers " + " | " + rpws + " | " + rpas + " | " + rpms + " | ") print ("Luggage area 1 " + " | " + la1ws + " | " + la1as + " | " + la1ms + " | ") print ("Luggage area 2 " + " | " + la2ws + " | " + la2as + " | " + la2ms + " | ") print ("Fuel USG 6lbs/gal " + " | " + fuelws + " | " + fuelas + " | " + fuelms + " | ") print ("Aircraft T/O weight " + " | " + tows + " | " + toas + " | " + toms + " | ") print ("Fuel used during fl " + " | " + fudfws + " | " + fuelas + " | " + fudfms + " | ") print ("Landing weight " + " | " + ldws + " | " + ldas + " | " + ldms + " | ")
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question