Lubnow_Brian_HW_9

# Lubnow_Brian_HW_9 - Enter the number of minutes used:288...

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

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

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Enter the number of minutes used:288 Number of minutes used: 288 Cost of phone bill: \$29.99 12R-CF 10/24/2011 ENGE1114-HW 9 Lubnow, Brian 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 3)Flowchart...
View Full Document

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern