Lubnow_Brian_HW_10

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

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

12R-CF 10/31/2011 ENGE1114-HW 10 Lubnow, Brian 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

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

View Full Document
12R-CF 10/31/2011 ENGE1114-HW 10 Lubnow, Brian PROBLEM STATEMENT:
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 12/05/2011 for the course ENGE 1114 taught by Professor Twknott during the Fall '06 term at Virginia Tech.

### Page1 / 3

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
Ask a homework question - tutors are online