{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

project5code

project5code - include include using...

Info icon This 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[] = "" //################################################# //
Image of page 1

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

View Full Document Right Arrow Icon
Sheet1 Page 2 // //Global Function // // //################################################# void getLine(char firstcity[], char secondcity[],int &numberchar) void getDistance(int &numberchar, char firstcity[], char secondcity[],char city[][MAX_STATIONS+1],int &numberstat, int miles[],int dollar[]) 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[], int miles[],int &numberstat, int &numberchar, char cur[]) void DisplayStationData(char city[][MAX_STATIONS+1],int &numberstat,
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern