project5code

Project5code - include include using namespace std GLOBAL VARIABLE ifstream fin ofstream fout ifstream sdata Input file Output

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

View Full Document Right Arrow Icon
Sheet1 Page 1 # include <iostream> # include <fstream> using namespace std //################################################# // // //GLOBAL VARIABLE // // //################################################# ifstream fin ofstream fout ifstream sdata //################################################# // // //Global Constant // // //################################################# const char DATA_FILE_NAME[] = "StationData.In" const char INFILE_NAME[] = "File5.In" const char OUTFILE_NAME[] = "File5.Out" const int MAX_STATIONS = 20 const int STATION_SIZE = 31 const int COST_SIZE = 12 const int DISTANCE_SIZE = 12 const int LINE_SIZE = 78 const int STOP_DISCOUNT = 1 const char TITLE[] = "TRAVEL ON THE SOUTHWEST CHIEF" const char THEAD [] = "Origin and Destination Stations:" char dstmsg[] = "Total Trip Distance:" char cstmsg[] = "Total Trip Cost:" const char SHEAD1[] = "Station Data Input" const char SHEAD2[] = "Station Data Table" const char STATXT[] = "Starting Station" const char DUPERR[] = "ERROR: Duplicate city skipped!" const char DOLERR[] = "ERROR: No dollar sign separator!" const char CSTERR[] = "ERROR: Invalid incremental cost!" const char DISERR[] = "ERROR: Invalid incremental distance!" const char ORGERR[] = "ERROR: Invalid origin city!" const char DESERR[] = "ERROR: Invalid destination city!" const char DONE[] = "Done." const char EMPTY[] = "" //################################################# //
Background image of page 1

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

View Full DocumentRight Arrow Icon
Sheet1 Page 2 // //Global Function // // //################################################# void getDistance(int &numberchar, char firstcity[], void putMoney(int Dprice, int Cprice) int main() { void initialize() char input[LINE_SIZE] char location[STATION_SIZE][MAX_STATIONS+1] char currency[MAX_STATIONS+1] int price[MAX_STATIONS+1] int distance[MAX_STATIONS+1] int stat int charact char startcity[STATION_SIZE] char destincity[STATION_SIZE] void readSationData(char input[],char city[][MAX_STATIONS+1],int dollar[],
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.

This note was uploaded on 04/12/2009 for the course CS 31 taught by Professor Melkanoff during the Winter '00 term at UCLA.

Page1 / 20

Project5code - include include using namespace std GLOBAL VARIABLE ifstream fin ofstream fout ifstream sdata Input file Output

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