TI-89 HomeGames ArchiveTitanium GamesGames How ToProgramsFAQForumTI-89 WikiLinks

Weight and balance program for aircraft

 
Post new topic   Reply to topic    Your TI-89 Resource Forum Index -> General Discussion & Bugs
Author Message
flyroyc



Joined: 13 Oct 2011
Posts: 2

PostPosted: October 13, 2011 2:47 PM    Post subject: Weight and balance program for aircraft Reply with quote

I wrote this because I simply could not find code written by someone else. It works well with one exception: I didn't know how to incorporate a way to escape or stop the program once it has started if the user wants to stop or accidently enters the wrong number for the for loop. anybody know how to do this?

Code:
:Balance()
:Prgm
:ClrIO
:1→x
:0→m
:0→w
:
:Input “How many items?”,n
:For i,1,n,1
:Display “Item”,i
:Input “weight(lbs)?”,y
:y+w→w
:PopUp {“arm”,”moment”},c
:If c=1 Then
:Input “arm(in)?”,x
:x*y+m→m
:ElseIf c=2 Then
:Input “moment(in-lbs)?”,x
:x+m→m
:
:EndIf
:EndFor
:
:Disp “Total weight”,w
:Disp “Total moment”,m
:Disp “Arm”,m/w
:Lbl finish
:Pause
:Dialog
:DropDown “finished?”,{“add/remove item”,”back”,”done”},e
:EndDlog
:If e=1 Then
:Input “How many items to add/remove?”,y
:For i,1,n,1
:Display “Item”,i
:Input “weight(lbs)?”,y
:y+w→w
:PopUp {“arm”,”moment”},c
:If c=1 Then
:Input “arm(in)?”,x
:x*y+m→m
:ElseIf c=2 Then
:Input “moment(in-lbs)?”,x
:x+m→m
:
:EndIf
:EndFor
:
:Disp “Total weight”,w
:Disp “Total moment”,m
:Disp “Arm”,m/w
:Goto finish
:ElseIf e=2 Then
:Goto finish
:
:EndIf
:
:EndPrgm
Back to top
View user's profile Send private message
flyroyc



Joined: 13 Oct 2011
Posts: 2

PostPosted: October 18, 2011 9:26 PM    Post subject: Reply with quote

I accidently discovered the cure... Simply press the "On" button to exit at anytime you desire.
Back to top
View user's profile Send private message
Display posts from previous:    View previous topic : View next topic  
Post new topic   Reply to topic    Your TI-89 Resource Forum Index -> General Discussion & Bugs All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Contact Us | Privacy Policy | Disclaimer | Trademarks

Copyright ©2006 All rights reserved.


Free Greeting Cards | Girly Myspace Layouts | Myspace Unblocker |