lab5ex3 -...

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

View Full Document Right Arrow Icon
// Program Frame4 reads input values that represent the // dimensions of a print from a file and calculates and // prints the amount of wood needed for a frame. . / #include <iostream> #include <fstream> using namespace std; u int main () { ofstream dout; ifstream din; int side; // vertical dimension in inches int top; // horizontal dimension in inches int inchesOfWood; // inches of wood needed cout.setf(ios::fixed, ios::floatfield); cout.setf(ios::showpoint);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: din.open(&quot;Frame.In.txt&quot;); din &gt;&gt; side &gt;&gt; top; dout.open(&quot;Frame.Out.txt&quot;); dout &lt;&lt; &quot;Dimensions are &quot; &lt;&lt; top &lt;&lt; &quot; and &quot; &lt;&lt; side &lt;&lt; &quot;.&quot; &lt;&lt; endl; inchesOfWood = top + top + side + side; dout &lt;&lt;&quot;You need &quot; &lt;&lt; inchesOfWood &lt;&lt;&quot; inches of wood.&quot; &lt;&lt; endl; cout &lt;&lt; &quot;Dimensions are &quot; &lt;&lt; top &lt;&lt; &quot; and &quot; &lt;&lt; side &lt;&lt; &quot;.&quot; &lt;&lt; endl; inchesOfWood = top + top + side + side; cout &lt;&lt; &quot;You need &quot; &lt;&lt; inchesOfWood &lt;&lt;&quot; inches of wood.&quot; &lt;&lt; endl; return 0; }...
View Full Document

This note was uploaded on 04/25/2010 for the course CECS CIS 150 taught by Professor L.tsui during the Fall '07 term at University of Michigan-Dearborn.

Ask a homework question - tutors are online