This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: t numStudents++ } ofstream outfile outfile.open("C:/Documents and Settings/*****/Desktop/output.txt") // or ofstream outfile("C:/Documents and Settings/*****/Desktop/output.txt") outfile << "ave weight: " << double (totalWeight)/numStudents << endl outfile << "ave height: " << double (totalHeight)/numStudents << endl infile.close() outfile.close() return 0 }// end of main Sheet1 Page 2 // fill in the asterisks with your PSU username...
View Full Document
- Fall '07
- Carriage return, #include, int height, ofstream outfile, ifstream infile, int numStudents