spring04_pset11

spring04_pset11 - Massachusetts Institute of Technology...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: Massachusetts Institute of Technology Department of Aeronautics and Astronautics Cambridge, MA 02139 16.03/16.04 Unified Engineering III, IV Spring 2004 Problem Set 11 Name: Due Date: 4/27/04 Time Spent (min) CP13-14 P5 P6 P7 S13 Study Time Announcements: Q5S will be on Friday, April 23. C13-14 The problems in this problem set cover lectures C13 and C14 1. a. Define a robust algorithm to carry out integer division using repeated subtraction. Your algorithm accepts two integers and returns the quotient and the remainder. Hint : What are the preconditions and postconditions of your algorithm? b. Implement your algorithm as an Ada95 program, using exception handling to provide robustness. Turn in a hard copy of your algorithm and code listing, and an electronic copy of your code. 2. a. What is the cyclomatic complexity of the code fragment shown below? loop exit when Flag := True; if A < 100 and B > 200 then if A > 50 then Sum := Sum + 2 ; else Sum := Sum + 1 ; end if ; else if B < 300 then Sum:= Sum - 1 ; else Sum := Sum - 2 ; end if ; end if ; end loop ; Hint : Draw the control flow graph b. What is the minimum number of test cases needed to test the fragment of code shown below? Justify your answer . if A < 100 and B > 200 then if A > 50 then Sum := Sum + 2 ; else Sum := Sum + 1 ; end if ; else if B < 300 then Sum:= Sum - 1 ; else Sum := Sum - 2 ; end if ; end if ; Unified Engineering Spring Term 2004 Problem P5. (Propulsion) (L.O. D) For a future high performance military fighter, with a wing loading (W/S) of 3500 N/m2, does it require does it require a higher ratio of thrust to weight to i) Perform a steady, constant altitude, constant speed 5g combat turn at M=0.9, or ii) Accelerate from M=0.5 to M=2 in 20 seconds?...
View Full Document

This note was uploaded on 01/28/2012 for the course AERO 16.01 taught by Professor Markdrela during the Fall '05 term at MIT.

Page1 / 11

spring04_pset11 - Massachusetts Institute of Technology...

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

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