Lubnow_Brian_HW_10

Lubnow_Brian_HW_10 - 12R-CF 10/31/2011 ENGE1114-HW 10...

Info iconThis preview shows pages 1–3. 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
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 12R-CF 10/31/2011 ENGE1114-HW 10 Lubnow, Brian 1/4 PROBLEM STATEMENT: Prepare a Matlab program for an algorithm to convert temperatures between Fahrenheit and Celsius. SOLUTION: % Prepared by Brian Lubnow, 10/30/11 %This program is designed to convert temperature between Celsius and Fahrenheit TEMPIN=input( 'Enter the numerical value of the temperature:' ); UNITS=input( 'Enter units of your temperature as either F or C: ' , 's' ); if UNITS== 'F' T1=TEMPIN-32; T2=T1*5; TEMPOUT=T2/9; fprintf( '\n%.1f %s is equal to %.1f C \n' ,TEMPIN,UNITS,TEMPOUT'); end if UNITS== 'C' T1=TEMPIN*9; T2=T1/5; TEMPOUT=T2+32; fprintf( '\n%.1f %s is equal to %.1f F \n' ,TEMPIN,UNITS,TEMPOUT'); end RESULTS Enter the numerical value of the temperature:15 Enter units of your temperature as either F or C: C 15.0 C is equal to 59.0 F Enter the numerical value of the temperature:55 Enter units of your temperature as either F or C: F 55.0 F is equal to 12.8 C 12R-CF 10/31/2011 ENGE1114-HW 10 Lubnow, Brian 2/4 PROBLEM STATEMENT:...
View Full Document

Page1 / 4

Lubnow_Brian_HW_10 - 12R-CF 10/31/2011 ENGE1114-HW 10...

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

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