Lubnow_Brian_HW_9

# Lubnow_Brian_HW_9 - 2/3 PROBLEM STATEMENT HW#9 Problem 2...

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

12R-CF 10/24/2011 ENGE1114-HW 9 Lubnow, Brian 1/3 PROBLEM STATEMENT: Prepare a MatLab program for an algorithm that will determine and output the amount of your monthly cell phone bill when you enter the number of minutes used during the month. SOLUTION: %Prepared by Brian Lubnow. 10/23/2011 %This is designed to calculate the cost of a phone bill %INITIALIZATION BASE=29.99; MININCL=300; COSTPERMIN=0.1; MINUSED=input( 'Enter the number of minutes used:' ); %CALCULATIONS MINOVER = MINUSED - MININCL; OVERCOST=MINOVER*COSTPERMIN; BILL=OVERCOST+BASE; fprintf( '\n Number of minutes used: %.0f\n' ,MINUSED); if MINUSED<=MININCL fprintf( '\n Cost of phone bill: \$%.2f\n' ,BASE); else fprintf( '\n Cost of phone bill: \$%.2f\n' ,BILL); end RESULTS Enter the number of minutes used:345 Number of minutes used: 345 Cost of phone bill: \$34.49 Enter the number of minutes used:288 Number of minutes used: 288 Cost of phone bill: \$29.99

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

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

Unformatted text preview: 2/3 PROBLEM STATEMENT: HW #9, Problem 2 SOLUTION: 1) HELP comments: % Prepared by Brian Lubnow on 10/23/2011. %Program is designed to calculate the surface area and the volume of polygon prism based on its height and the length of its sides 2) Outputs of program For a polygon prism with height= 2.00 cm And 3 sides of side length=.50 cm Surface area = 3.22 cm^2 And volume= .22cm^3 For a polygon prism with height= 2.00 cm And 6 sides of side length=.50 cm Surface area = 7.30 cm^2 And volume= 1.30cm^3 For a polygon prism with height= 2.00 cm And 9 sides of side length=.50 cm Surface area = 15.18 cm^2 And volume= 3.09cm^3 12R-CF 10/24/2011 ENGE1114-HW 9 Lubnow, Brian 3/3 3)Flowchart Start INPUT MaxSides Increment Side Length Height FOR N from 3 through MaxSides by Increment Abase=N*S^2/4*tand(180/N) Perim=N*S V=Abase*H SA=2*Abase+Perim*H MaxSides=0 Increment=0 Side Length=0 Height=0 SA=0 V=0 Abase=0 Perim=0 STOP OUTPUT SA, V...
View Full 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_9 - 2/3 PROBLEM STATEMENT HW#9 Problem 2...

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

View Full Document
Ask a homework question - tutors are online