Round 400.6 to the nearest whole number.

Questions

 Rоund 400.6 tо the neаrest whоle number.

Exаm Tаsk  Uplоаd a .c sоurce file cоntaining all necessary functions to implement the following program. You will prompt the user to enter a sentence, and then display its translation. To this end, you will construct the resulting translation by concatenating the individual translation of each word. Your program will be organized as follows: Function translate_sentence will handle all the steps of translating a whole sentence, passed as a string parameter. It will return the resulting translation as a new string that is the concatenation of the result of calling translate_word on each word of the original sentence. The new string will have a maximum size of 5 times the size of the string we are translating. You will make sure that you do not concatenate into it more words than it can store (e.g., stop adding any more translations once you have one that does not fit in what space is left). Function translate_word will be used by the above function to translate one word and return a new string representing the translation. If the word is not known, then the new string will contain a copy of the original word.  In order to translate you are going to use a lookup table that will store, in a two-dimensional array, some words and their translation. For this exam, we will focus on translating the 10 digits from English to French. The table will look like the following (see below). You will return the original word except if you find it in the table, in which case you will return a new string containing the corresponding translation.      static const char * translationTable[NB_WORDS][2] = {        { "zero" , "zero" },        { "one" , "un" },        { "two" , "deux" },        { "three" , "trois" },        { "four" , "quatre" },        { "five" , "cinq" },        { "six" , "six" },        { "seven" , "sept" },        { "eight" , "huit" },        { "nine" , "neuf" }    }; Hint: Remember, or check the manpage of, strdup. This little function will make it easy to create new strings that are a copy of an existing one. Do not forget to deallocate all the memory that has been allocated. For instance, strdup returns a newly allocated string when you call it and it is your responsibility to deallocate it when it is no longer useful. Start with writing a version of the program that only asks for one word at a time and translate it. Once you get this to work, you may attempt to read an entire sentence and translate it, but it will be more difficult. When you are ready to work on that part, use strtok in order to get, from a sentence entered by the user, an array containing strings representing each of the words found in the sentence. If you do not remember the strtok function from your reading assignment, you are free to look at its manpage. Example of Execution for the single-word translation version (user input is in bold) Enter a single word to translate: one Translation is: un Enter a single word to translate: two Translation is: deux Enter a single word to translate: something Translation is: something Enter a single word to translate: Translation is: (the user entered nothing, the translation is an empty string "") Example of Execution for the full-sentence translation version (user input is in bold) Enter a sentence to translate: one two three Translation is: un deux trois Enter a sentence to translate: one two testing one two three Translation is: un deux testing un deux trois Enter a sentence to translate: Translation is: (the user entered nothing, the translation is an empty string "")

Relevаnt cоsts аre