GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

The vagus nerve provides parasympathetic innervation to whic…

The vagus nerve provides parasympathetic innervation to which of the following structures in the thorax?

Read Details

The tibial nerve innervates most of the muscles in the poste…

The tibial nerve innervates most of the muscles in the posterior compartment of the leg. Which of the following functions is primarily controlled by this nerve?

Read Details

Match the gland to the location where its duct opens in the…

Match the gland to the location where its duct opens in the oral cavity: 

Read Details

The sternocleidomastoid muscle is involved in which of the f…

The sternocleidomastoid muscle is involved in which of the following actions?

Read Details

The basal ganglia are involved in motor control. How does th…

The basal ganglia are involved in motor control. How does this knowledge apply to occupational therapy?

Read Details

Which of the following layers of the meninges is the outermo…

Which of the following layers of the meninges is the outermost and toughest layer?

Read Details

The flexor hallucis longus muscle is responsible for flexing…

The flexor hallucis longus muscle is responsible for flexing which part of the foot?

Read Details

Match the Bone of the Head with its Corresponding Descriptio…

Match the Bone of the Head with its Corresponding Description or Feature:

Read Details

A. Which cranial nerve carries general sensory fibres from t…

A. Which cranial nerve carries general sensory fibres from the anterior 2/3 of the tongue? [BLANK-1]   B. Which two muscles form the floor of the mouth? [BLANK-2] [BLANK-3]

Read Details

Exam Task  Upload a .c source file containing all necessary…

Exam Task  Upload a .c source file containing all necessary functions to implement the following program. Your program will implement a translator for a fake language to be used in a video game. You will prompt the user to enter a sentence, 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, and return the resulting translation. Function translate_word will be used by the above to translate one word into our fake language and return a string representing the translation. In order to translate any given English word, our function will simply measure the number of characters that it contains, and then return a copy of a translation string that will be found in an array containing, for each length of word between 1 and 8 characters, the fake language word to be used as translation. Any word longer than 8 characters will be translated as “AFGURNM”. If an empty string “” is being translated, the table will contain its translation at index 0 as “”. Here is the table you should be using: 1 “A” 5 “CETER” 2 “DO” 6 “SOLURE” 3 “TER” 7 “KELTRAM” 4 “QORA” 8 “OKENUFAL” Hint: 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 lookup its manpage. Example of Execution for the single-word translation version (user input is in bold) Enter a single word to translate: hello Translation is: CETER Enter a single word to translate: welcome Translation is: KELTRAM 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: hello people Translation is: CETER SOLURE Enter a sentence to translate: I do not know what it says Translation is: A DO TER QORA QORA DO QORA Enter a sentence to translate: Translation is: (the user entered nothing, the translation is an empty string “”)   Grading Criteria:  Your program will be evaluated based on the following criteria:  Rubric # Pts Additional Grading Notes The program compiles without compilation errors or warnings 3 Deduct 1 point per minor compilation error (e.g., typo, forgotten semi-colon, forgotten or extra curly braces or parentheses). If the program does not compile due to too many errors or due to an error that is non-trivial to fix (see above), then the whole assignment receives zero points. The program executes without crashing at runtime 3 Deduct one point for each use case that leads the program to crash (maximum 3) The translate_word function takes a string as parameter and returns a string representing its translation, according to the provided table. 3 3 – Implemented according to requirements 2 – Mostly properly implemented 1 – Not properly implemented 0 – not implemented The translate_word function handles correctly strings longer than 8 characters. 3 3 – Implemented according to requirements 2 – Mostly properly implemented 1 – Not properly implemented 0 – not implemented The translate_word function handles correctly the translation of empty strings. 3 3 – Implemented according to requirements 2 – Mostly properly implemented 1 – Not properly implemented 0 – not implemented The translate_sentence function correctly calls strtok in order to obtain an array of strings each representing a word of the sentence passed as parameter. 3 3 – Implemented according to requirements 2 – Mostly properly implemented 1 – Not properly implemented 0 – not implemented The translate_sentence function correctly iterate over each of these words and concatenate their translation (according to translate_word) in a string that is then returned. 3 3 – Implemented according to requirements 2 – Mostly properly implemented 1 – Not properly implemented 0 – not implemented The main method prompts the user to enter a single word, and translate it, until they enter an empty string. At that point, it prompts the user to enter a full sentence, and translate it, until they enter another empty string. 3 3 – Implemented according to requirements 2 – Mostly properly implemented 1 – Not properly implemented 0 – not implemented Total 24  

Read Details

Posts pagination

Newer posts 1 … 43,995 43,996 43,997 43,998 43,999 … 78,897 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top