/*------------------------------------------------*/ void Receive(void) /**/ /* Inputs: Receives emailed responses*/ /* Outputs: Once all new emails read, function passes control to UI*/ /* Comments: If new email response has been received, passes information to ResponseToFile(). This function runs after every time the user performs an action. This way the user can see new responses as they come.*/ /*------------------------------------------------*/ /*----------------------------------------------------------------------------------------------------*/ int UI() /**/ /*Inputs: takes in the numerical input which is used to select which program function is needed.*/ /*Outputs: the same as input integer so i can = 0 or > 0. If it's zero program closes loop and exits program*/ /*Comments: request an integer, so 1 = "send" function 2 = "view" function 0 = exit*/ /*----------------------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------------------------------------------*/ void ResponseToFile(char[] Name, char[] Email, int Status, int Food, char[3][] Music); void ResponseToFile(char[] Name, char[] Email, int Status, int Food, char[3][] Music, char[] Name2, char[] Email2, int Status2, int Food2, char[3][] Music2);//etc. /**/ /*Inputs: All info about one or more guests' response*/ /*Outputs: None*/ /*Comments: The function is overloaded to handle Receive() sending it info about one or more people. If the function needs to be able to handle more than 2 people, the above overloading can be expanded to "...char[] Name3, etc."*/ /*If only one person's info is sent to the function, it will pass that info to fileWriter(). If more than one person's info is sent, it will pass the info to fileWriter one person at a time*/ /*---------------------------------------------------------------------------------------------------------------------------*/\ /*---------------------------------------------------------------------------------------------------------------------------*/\ void fileWriter(char[] Name, char[] Email, int Status, int Food, char[3][] Music);\ /**/\ /*Inputs: All info about one guest's response*/\ /*Outputs: None*/\ /*Comments: First checks file for an entry for person "Name." If the entry is found, fileWriter() fills in the Status, Food, and Music selection. If entry is not found, it creates a new entry for the person and fills in the pertinent information.*/\ /*---------------------------------------------------------------------------------------------------------------------------*/\ \ /*---------------------------------------------------------------------------------------------------------------------------*/\ int ViewResponses():\ /**/\ /* input: User's decission.*/\ /* output: Displays all, Song decision, no or yes( late or early)*/\ /* comments: User chooses to view responses 0,1, 2, or 3. 0 for all, 1 for yes, 2 for no or 3 for song requests.\ If the user presses 1, then the user will decide between early or late arrival.*/\ /*---------------------------------------------------------------------------------------------------------------------------*/\ \ /*---------------------------------------------------------------------------------------------------------------------------*/\ int view Coming_Guests():\ /**/\ /* input: User's decission.*/\ /* output: Displays all, late, early.*/\ /* comments: User chooses to view responses 0,1 ,2. 0 for all, 1 for late, 2 for early.\ If the user presses 2, then the user will choose to see the food preferences (foodpref()).*/\ /*---------------------------------------------------------------------------------------------------------------------------*/\ \ /*---------------------------------------------------------------------------------------------------------------------------*/\ void view foodpref(int):\ /**/\ /* input: User's decission.*/\ /* output: Displays vegetarian, kosher, halal, vegan, no lactose, no gluten, no nuts or no preference.*/\ \ /* comments : user chooses to view the food preferences of the guests.\ chooses between 0, 1, 2, 3 ,4, 5, 6, 7, 8.\ 0 for vegetarian\ 1 for kosher\ 2 for halal\ 3 for vegan\ 4 for no lactose\ 5 for no glutten\ 6 for no nuts\ 7 for no preference\ 8 for not having dinner\ */ \ /*---------------------------------------------------------------------------------------------------------------------------*/\ \ /*----------------------------------------------*/\ void OneDayBefore();\ /* */\ /*input : None*/\ /*output : None.*/\ /*comment: If it's the day before party, it will call SendReminder(char[], char[]) for every name on the list.*/\ /*----------------------------------------------*/\ \ /*----------------------------------------------*/\ int SendReminder(char[] Name, char[] Email);\ /* */\ /*input : Validated guests' name and email address*/\ /*output : Automatic reminder will be sent to valid guests' email address*/\ /*comment: Sends reminder to email address provided. Reminder status reminderInt set to 1.*/\ /*----------------------------------------------*/ \ \ /*------------------------------------------------------------------------------------------------------------*/\ int Name();\ /**/\ /*Inputs: User will key in name and address by hitting keyboard.*/\ /*Outputs: The name will be displayed.*/\ /*Comments: First Input part done.*/\ /*-----------------------------------------------------------------------------------------------------------*/\ \ /*------------------------------------------------------------------------------------------------------------*/\ int Valid(char[], char[]);\ /**/\ /*Inputs: Receive first and second inputs.*/\ /*Outputs: Valid or invalid will be returned*/\ /*Comments: If name and email address are valid and are not already present in the file, valid is returned. Otherwise invalid is returned.*/\ /*------------------------------------------------------------------------------------------------------------*/\ \ /*-----------------------------------------------------------------------------------------------------------*/\ int Send();\ /**/\ /*Inputs: The valid email address that had been matched in memory.*/\ /*Outputs: Invitation will be sent to the email address. */\ /*Comments: Only valid data will be read and will be sent to email address. */\ /*------------------------------------------------------------------------------------------------------------*/\ \ /*---------------------------------------------------------------------------------------------------------*/\ void Write(char[], char[]);\ /**/\ /*Inputs: Valid name and email */\ /*Outputs: None*/\ /*Comments: Writes name and email address to file. Sets reminderInt, statusInt, and footInt to 0 and leaves blanks for music requests*/\ /*---------------------------------------------------------------------------------------------------------*/\ \ /*----------------File-Format--------------------------------*/\ ------------FILE------------\ | firstName familyName\\0 |\ | email@address\\0 |\ | reminderInt\\0 |\ | statusInt\\0 | //0: no response; 1: yes, 2: no, 3: come late\ | foodInt\\0 | //0-7; 0: no response, 1-7: food decision \ | artistName1 songName\\0 |\ | artistName2 songName\\0 |\ | artistName3 songName\\0 |\ |%%%%%%%%%%%%%%%%%%%%%%%%%|\ | firstName familyName\\0 |\ |... ... . ... ... ... ...|\ -----EndOfFile--------------\ /*-----------------------------------------------------------------*/