This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: heron_A = sqrt(s*(s side_a)*(s side_b)*(s side-c)); end % Line #: 11 % Error: the logic incorrectly uses & conditions % Fix: change to side_a || side_b || side_c. % Line #: 13 % Error: uses elseif condition rather than else condition % Fix: change to else. % Line #: 15 % Error: the variable heron_A not returned by the function % Fix: change the variable to heron_area. % Line #: 15 % Error: undefined variable side-c % Fix: change the variable to side_c. % Line #: 11/12 % Error: if a side has negative length, heron_area not defined so function has undefined output. % Fix: add an initialization for heron_area to line 9....
View Full Document
This note was uploaded on 05/02/2011 for the course ENGR 132 taught by Professor Kutson during the Spring '11 term at Purdue.
- Spring '11