CHE110-L11 - Decision Constructs for Conditionally Executed...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Department of Chemical Engineering Decision Constructs for Conditionally Executed Statements If Then Else & Select Case Constructs CHE110 Introduction to Programming & Problem Solving
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Department of Chemical Engineering Decisions, Decisions. .. Launch of a Model Rocket Rocket Dynamics 2 ii i 1 hh v t a t 2 vv a t =+⋅ + =+ • Stage 1 • rocket fires for t f seconds due to F •h i = 0, v i = 0, a = F/m – g • Stage 2 • rocket decelerates until v = -v chute •a = - g • Stage 3 • chute deploys and rocket descends at constant rate v chute = 0 stage 1 stage 2 stage 3 h 1 , v 1 h 2 , t 2 rocket dynamics program t h , v
Background image of page 2
Department of Chemical Engineering Decisions, Decisions. .. Launch of a Model Rocket Program Logic If t <= t f then stage 1 dynamics else solve for h 1 , v 1 if v > -v chute then stage 2 dynamics else stage 3 dynamics solve for h 1 , v 1 , h 2 , v 2 if h < 0 error message end end end Program Logic If t <= t f then stage 1 dynamics else solve for h 1 , v 1 if v > -v chute then stage 2 dynamics else stage 3 dynamics solve for h
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/08/2009 for the course CHE 101 taught by Professor Coronel during the Spring '06 term at Rose-Hulman.

Page1 / 10

CHE110-L11 - Decision Constructs for Conditionally Executed...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online