Lab 5 Report

# Lab 5 Report - Lab#5 14 February 2007 Chris Sutherland 11W...

This preview shows pages 1–3. Sign up to view the full content.

Lab #5 14 February 2007 Chris Sutherland 11W Part 1 1.) There are no real roots. ----Run finished---- 2.) 4 -6 ----Run finished---- 3.) Start "Coefficient A = ?" GET A "Coefficient B = ?" GET B "Coeffecient C = ?" GET C (B ^ 2 - ( 4 * A * C )) < 0 PUT "There are no real roots."¶ Root1 ← ( - B + sqrt(B ^ 2 - 4 * A * C)) / (2 * A); Root2 ← ( - B - sqrt(B ^ 2 - 4 * A * C)) / (2 * A); PUT Root1¶ PUT Root2¶ No Yes End Chris Sutherland EngE 1104 14 Feb 2007 Solves a quadratic formula

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

View Full Document
Part 2 1.) % Chris Sutherland % EngE 1104 % Feb. 14, 2006 New_Var = input( 'Enter the coefficients of your equation to find its roots.' ); A = input( 'What is the coefficient in front of the squared term?' ); B = input( 'What is the coefficient in front of the variable?' ); C = input( 'What is the constant?' ); if (B^2 - (4 * A * C))<0 fprintf( 'No real roots.\n' ); else Root1 = (-B + sqrt(B^2 - 4 * A * C))/(2 * A); Root2 = (-B - sqrt(B^2 - 4 * A * C))/(2 * A); fprintf( '\n Root 1 = %f' , Root1); fprintf( '\n Root 2 = %f'
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 3

Lab 5 Report - Lab#5 14 February 2007 Chris Sutherland 11W...

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

View Full Document
Ask a homework question - tutors are online