soccerTrack02

SoccerTrack02 - trackIn>> sideLine trackIn>> endLine cout<< endl<< endl totalDistance = sideLine sideLine endLine endLine

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

View Full Document Right Arrow Icon
// file: soccerTrack02.cpp // author: j. dzuback // date: 09/10/09 / /* *************** the program retrieves the length and width (in yards) of the soccer pitch from a disk file. It then calculates the distance a player, running on the outside edge of the pitch, would cover. **************** */ #include <fstream> #include <iostream> using namespace std; u int main() { int sideLine; int endLine; int totalDistance; ifstream trackIn; ofstream TrakData; trackIn.open("E:\\BackUp\\Skol Stuffs\\U.C.C\\CSC\\Lab 04\\trackdata.in"); TrakData.open("E:\\BackUp\\Skol Stuffs\\U.C.C\\CSC\\Lab 04\\TrakData.out");
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: trackIn >> sideLine; trackIn >> endLine; cout << endl << endl; totalDistance = sideLine + sideLine + endLine + endLine; cout << "With a side line of " << sideLine << " yards," << " and an end line of "; cout << endLine << " yards," << endl; cout << "the player will run " << totalDistance << " yards around the soccer pitch"; cout << endl << endl; TrakData << sideLine <<endl; TrakData << endLine <<endl; trackIn.close(); TrakData.close(); return 0; } // end of main...
View Full Document

This note was uploaded on 02/08/2011 for the course CSC 101 taught by Professor Joedzuback during the Spring '11 term at Union County.

Ask a homework question - tutors are online