program need to be in c language. thank you
LTE moodie2.mcneese.edu LAB 4 PROGRAM: PRINTING A ONE-MONTH REMINDER LIST The remind.c program prints a one-month list of daily reminders The user will enter a series of reminders, with cach prefixed by a day of the month. When the user enters 0 instead of a valid day, the program will print a list of all reminders entered, sorted by day We limit the number of reminders to 50 and the length of the message to 0 characters. dimensional array of characters, each row of the array contains one string/message. We also declare 2 1D arrays, one for the user's day input and one for the user's message input. We want the string to be 1 longer than the max length so we can add our O. In order to make reading in values easier, we also declare integers to track days, NumberReminder and StringReminder for loops, and num remind for tracking the reminders in the 2D The strings will be stored in a two- Lneludeng define 60 loop for Here is an example of a session of the code: (the underlined portions are the user's input.) Ester day and remlinder: 24 Susan's birthdey Ester day and reninders Ester day and reminder: 10 Ester day and reminder: 5 Seturdey elass Ester day and reninders Day Reminder ueday class 6:00- Dinner with Marge and 2 Novie-o to Tealn Your Dragon 4 Susan"a birthday We need a loop for the user's input. If the user attempts to add more than the max number of messages, you need to tell them they have reached the end of their allowable input. We read in the day and if its 0, it will exit the program and print the results. At this point it will just exit the program since we have not added the rest of the code. We also increment the number of reminders in order to keep the user from going over their limit 7:12 LTE We need a loop for the user's input. If the user attempts to add more than the max number of messages, you need to tell them they have reached the end of their allowable input. We read in the day and if its 0, it will exit the program and print the results. At this point it will just exit the program since we have not added the rest of the code. We also increment the number of reminders in order to keep the user from going over their limit sd oop ass string reang cod Overall strategy for the program: 2. Store them in order (sorted by day). 3. Display them. We use scanf to read in the days and a read line function to read in the reminder message. Do not add num remind++ and the final 3 again, they are only for reference. Only add the code in the black box below Add the read line) function AFTER the end of the main function Actions taken after the program reads a reminder day and its associated Search the array y to determine where the day belongs, using strcmp to do comparisons. Use strcpy to move all strings below that point down one position. Copy the day into the array and call strcat to append the reminder to the day 7:12 moodle2.mcneese.edu Actions taken after the program reads a day and its associated reminder. Search the array to determine where the day belongs, using stremp to do comparisons Use strcpy to move all strings below that point down one position. Copy the day into the array and call strcat to append the reminder to the day Ons complication; how to right-justify the days in a two- character field. The solution is to use scanf to read the day into an integer variable, than call sprintf to convert the day back into string form. sprintf is similar toprintf, except that it writes output into a string. An example of the call can be seen below sprintf (day_str,"2d", day) writes the value of day into day_str The following call of scanf ensures that the user doesn't enter more than two digits: scanf("2d" day) added code version 2. Prints day and Run the code and complete several test inputs: 1. Create he following new functions: (For replacement, copy and delete, the 2D array should be sorted correctly as any new entry. Make sure these calls happen in a switch statement before the sorting occurs so you do not duplicate code.) a. A function for user input. Create a list of possible LTE moodle2.mcneese.edu 1. Create he following new functions: (For replacement, copy and delete, the 2D array should be sorted correctly as any statement before the sorting occurs so you do not duplicate a. A function for user input. Create a list of possible new entry. Make sure these calls happen in a switch options. See new functions below for list. The call to this function should replace the line of code "Enter day and reminder:" Have the switch statement for the returned integer choice b. A new function to print the current 2D array when requested by the user. "Display current reminders c. A new function to let the user delete a reminder Assign an integer value to the rows the user to enter to tell you which one they want to starting with 0 for You do not want blank spaces in your 2D array. (Hint use the index supplied by the user as your starting point i, and use a for loop to move each i+1 up to the i row.) Example: Delete index 2 Move 3, 4, and 3 up one. le 3 is now in index 2. 4 is now in index 3. 5 is now in index 4 d. A new function to let the user replace a reminder. They can completely replace the day and or the reminder. Assign an integer value to the rows starting with 0 for the user to enter to tell you which one they want to replace. See #2 e. A new function to let the user add to the end of a current message. Assign an integer value to the rows starting with 0 for the user to enter to tell you which one they want to add to. See #2. f. A new function to let the user copy a current reminder exactly. The correctly as any new entry. Assign an integer value to the rows starting with 0 for the user to enter to tell you which one they want to copy. See #2. new copy should be sorted g. A new function allowing the user to see the length of a message. Assign an integer value to the rows 7:12 LTE moodle2.mcneese.edu d. A new tunction to let the user replace a reminder. They can completely replace the day and or the reminder. Assign an integer value to the rows starting with 0 for the user to enter to tell you which one they want to replace. See #2. e. A new function to let the user add to the end of a current message. Assign an integer value to the rows starting with 0 for the user to enter to tell you which one they want to add to. See #2. f. A new function to let the user copy a current reminder exactly. The new copy should be sorted correctly as any new entry. Assign an integer value to the rows starting with 0 for the user to enter to tell you which one they want to copy. See #2- g. A new function allowing the user to see the length of a message. Assign an integer value to the rows starting with 0 for the user to enter to tell you which one they want the length of. See 2 h. Example of new user input prompt Make sure to add a #7 for them to-Add a new reminder. 2. Each time in your new functions that you need to print out a list of indexes, days, and messages, this should be a nes function you create that displays the list and then returns an integer value of the selected index to the function. Use a function to avoid duplicating code. That is a bad coding practice. Make sure the user does not enter an index that does not exist. (Hint use num reminder). Choose the 4parsy 3. Error Checking, Required: a. Let the user know when their message is over the max length of the messages. Let them re-enter the message. b. Let the user know when their reminder is going to exceed the allowable number of reminders. Let them choose to exit, or delete to make room and add more etc. e. Let the user know if they attempt to add a day larger than the 31 LTE moodie2.mcneese.edu LAB 4 PROGRAM: PRINTING A ONE-MONTH REMINDER LIST The remind.c program prints a one-month list of daily reminders The user will enter a series of reminders, with cach prefixed by a day of the month. When the user enters 0 instead of a valid day, the program will print a list of all reminders entered, sorted by day We limit the number of reminders to 50 and the length of the message to 0 characters. dimensional array of characters, each row of the array contains one string/message. We also declare 2 1D arrays, one for the user's day input and one for the user's message input. We want the string to be 1 longer than the max length so we can add our O. In order to make reading in values easier, we also declare integers to track days, NumberReminder and StringReminder for loops, and num remind for tracking the reminders in the 2D The strings will be stored in a two- Lneludeng define 60 loop for Here is an example of a session of the code: (the underlined portions are the user's input.) Ester day and remlinder: 24 Susan's birthdey Ester day and reninders Ester day and reminder: 10 Ester day and reminder: 5 Seturdey elass Ester day and reninders Day Reminder ueday class 6:00- Dinner with Marge and 2 Novie-o to Tealn Your Dragon 4 Susan"a birthday We need a loop for the user's input. If the user attempts to add more than the max number of messages, you need to tell them they have reached the end of their allowable input. We read in the day and if its 0, it will exit the program and print the results. At this point it will just exit the program since we have not added the rest of the code. We also increment the number of reminders in order to keep the user from going over their limit 7:12 LTE We need a loop for the user's input. If the user attempts to add more than the max number of messages, you need to tell them they have reached the end of their allowable input. We read in the day and if its 0, it will exit the program and print the results. At this point it will just exit the program since we have not added the rest of the code. We also increment the number of reminders in order to keep the user from going over their limit sd oop ass string reang cod Overall strategy for the program: 2. Store them in order (sorted by day). 3. Display them. We use scanf to read in the days and a read line function to read in the reminder message. Do not add num remind++ and the final 3 again, they are only for reference. Only add the code in the black box below Add the read line) function AFTER the end of the main function Actions taken after the program reads a reminder day and its associated Search the array y to determine where the day belongs, using strcmp to do comparisons. Use strcpy to move all strings below that point down one position. Copy the day into the array and call strcat to append the reminder to the day 7:12 moodle2.mcneese.edu Actions taken after the program reads a day and its associated reminder. Search the array to determine where the day belongs, using stremp to do comparisons Use strcpy to move all strings below that point down one position. Copy the day into the array and call strcat to append the reminder to the day Ons complication; how to right-justify the days in a two- character field. The solution is to use scanf to read the day into an integer variable, than call sprintf to convert the day back into string form. sprintf is similar toprintf, except that it writes output into a string. An example of the call can be seen below sprintf (day_str,"2d", day) writes the value of day into day_str The following call of scanf ensures that the user doesn't enter more than two digits: scanf("2d" day) added code version 2. Prints day and Run the code and complete several test inputs: 1. Create he following new functions: (For replacement, copy and delete, the 2D array should be sorted correctly as any new entry. Make sure these calls happen in a switch statement before the sorting occurs so you do not duplicate code.) a. A function for user input. Create a list of possible LTE moodle2.mcneese.edu 1. Create he following new functions: (For replacement, copy and delete, the 2D array should be sorted correctly as any statement before the sorting occurs so you do not duplicate a. A function for user input. Create a list of possible new entry. Make sure these calls happen in a switch options. See new functions below for list. The call to this function should replace the line of code "Enter day and reminder:" Have the switch statement for the returned integer choice b. A new function to print the current 2D array when requested by the user. "Display current reminders c. A new function to let the user delete a reminder Assign an integer value to the rows the user to enter to tell you which one they want to starting with 0 for You do not want blank spaces in your 2D array. (Hint use the index supplied by the user as your starting point i, and use a for loop to move each i+1 up to the i row.) Example: Delete index 2 Move 3, 4, and 3 up one. le 3 is now in index 2. 4 is now in index 3. 5 is now in index 4 d. A new function to let the user replace a reminder. They can completely replace the day and or the reminder. Assign an integer value to the rows starting with 0 for the user to enter to tell you which one they want to replace. See #2 e. A new function to let the user add to the end of a current message. Assign an integer value to the rows starting with 0 for the user to enter to tell you which one they want to add to. See #2. f. A new function to let the user copy a current reminder exactly. The correctly as any new entry. Assign an integer value to the rows starting with 0 for the user to enter to tell you which one they want to copy. See #2. new copy should be sorted g. A new function allowing the user to see the length of a message. Assign an integer value to the rows 7:12 LTE moodle2.mcneese.edu d. A new tunction to let the user replace a reminder. They can completely replace the day and or the reminder. Assign an integer value to the rows starting with 0 for the user to enter to tell you which one they want to replace. See #2. e. A new function to let the user add to the end of a current message. Assign an integer value to the rows starting with 0 for the user to enter to tell you which one they want to add to. See #2. f. A new function to let the user copy a current reminder exactly. The new copy should be sorted correctly as any new entry. Assign an integer value to the rows starting with 0 for the user to enter to tell you which one they want to copy. See #2- g. A new function allowing the user to see the length of a message. Assign an integer value to the rows starting with 0 for the user to enter to tell you which one they want the length of. See 2 h. Example of new user input prompt Make sure to add a #7 for them to-Add a new reminder. 2. Each time in your new functions that you need to print out a list of indexes, days, and messages, this should be a nes function you create that displays the list and then returns an integer value of the selected index to the function. Use a function to avoid duplicating code. That is a bad coding practice. Make sure the user does not enter an index that does not exist. (Hint use num reminder). Choose the 4parsy 3. Error Checking, Required: a. Let the user know when their message is over the max length of the messages. Let them re-enter the message. b. Let the user know when their reminder is going to exceed the allowable number of reminders. Let them choose to exit, or delete to make room and add more etc. e. Let the user know if they attempt to add a day larger than the 31