C++HW5 - /Homework #5 /This program will display a list of...

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

View Full Document Right Arrow Icon
//Homework #5 //This program will display a list of scores #include <iostream> #include <iomanip> #include <cmath> #include <fstream> using namespace std; void swap ( double &v1, double &v2); // POST: exchange the values in v1 and v2 void sort ( double &v1, double &v2, double &v3); // POST: reorder values such that v1 <= v2 <= v3 double final ( double v1, double v2, double v3); // PRE: v1 <= v2 <= v3 // POST: return the weighted sum: ½ v1 + v2 + ½ v3 void output (ostream &out, char first, char last, double sc1, double sc2, double sc3, double final); // PRE: sc1 <= sc2 <= sc3 // POST: display first and last initials, 3 scores in ascending order, and final score to out int main() { char first; char last; double v1, v2, v3; double total; double high; char highfirst; char highlast; ofstream fout; fout.open ( "output.txt" ); ifstream fin; fin.open( "data.txt" ); fin >> first >> last >> v1 >> v2 >> v3; cout << "Gymnastics Meet by Steve Carr\n\n" ;
Background image of page 1

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

View Full DocumentRight Arrow Icon
fout << "Gymnastics Meet by Steve Carr\n\n"
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

C++HW5 - /Homework #5 /This program will display a list of...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online