w1ws - to be used as inside diameter: '); ID = (P/100)*OD;...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
%W2WS - the starter program for ENGE 1114 Week 2 Workshop F 2010  %This is an example what NOT to do.  It is difficult to  %understand the program because the variable names are meaningless.  It  %would also be difficult to find any errors in the statements since we  %don't recognize the equations.    EoSI = input('Enter the units: ', 's'); OD = input( 'Enter the cylinder outside diameter in  centimeters: ');  EoSI = input('Enter the units: ', 's'); H = input('Enter the cylinder height: ');  EoSI = input('Enter the units: ', 's'); P = input('Enter the percentage of outside diameter 
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: to be used as inside diameter: '); ID = (P/100)*OD; AreaTopBottom = (pi*(0.5*OD)^2)-(pi*(0.5*ID)^2); CircumferenceOuter = 2*pi*(0.5*OD); CircumferenceInner = 2*pi*(0.5*ID); Volume = AreaTopBottom*H; SurfaceArea = (CircumferenceOuter*H)+(CircmferenceInner*H)+AreaTopBottom ; fprintf (' For a cylinder with outside diameter = %f %s and height =%f %s\n' , OD, EoSI ,H, EoSI) fprintf(' Volume = %f %s^3\n', Volume, EoSI) fprintf( ' Surface Area = %f %s^2 \n', SurfaceArea, EoSI)...
View Full Document

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

Ask a homework question - tutors are online