lab5ex3 - din.open"Frame.In" din>> side>>...

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; 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("Frame.In.txt"); din >> side >> top; dout.open("Frame.Out.txt"); dout << "Dimensions are " << top << " and " << side << "." << endl; inchesOfWood = top + top + side + side; dout <<"You need " << inchesOfWood <<" inches of wood." << endl; cout << "Dimensions are " << top << " and " << side << "." << endl; inchesOfWood = top + top + side + side; cout << "You need " << inchesOfWood <<" inches of wood." << 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