/*************************************************************/ /* File: io.cpp */ /* Purpose: This program will read in all data included */ /* in States.data.txt and print it */ /*************************************************************/ #include "State.h" #include "Date.h" #include "deltext.h" #include using namespace std; void readStates(State sList[]); void printAllStates(State sList[]); void encodeStates(State sList[]); void decodeState(State &S); const int MAXSTATES = 50; int main() { State sList[50]; readStates(sList); printAllStates(sList); encodeStates(sList); State S; decodeState(S); cout << "Decoded State:\n" << S << endl; return 0; } /**************************************************************/ /* Function Name: readStates */ /* Purpose: Reads in all required information from the */ /* State.data.txt file and stores it to an array of */ /* the type State */ /* */ /* Parameters */ /* State sList[] - REFERENCED - Array of the type State to */ /* store all state info */ /**************************************************************/ void readStates(State sList[]) { //Open input file for reading ifstream infile; infile.open("States90.txt"); if(infile.fail()) { cout<>sList[count]; } /**************************************************************/ /* Function Name: printAllStates */ /* */ /* Purpose: Prints all states in State array to the screen */ /* */ /* Parameters */ /* State sList - REFERENCED - State array */ /* */ /* RETURN VALUE - VOID */ /**************************************************************/ void printAllStates(State sList[]) { for(int count = 0; count < MAXSTATES; count++) cout<