Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write the code in C language. Also please make sure the code meets the requirements. I need the answer as soon as possible. Thank you!
Write the code in C language. Also please make sure the code meets the requirements. I need the answer as soon as possible. Thank you!
4. Write a function that takes the name of a file, an input string and an output string. The file is of this format: Ag C D ! S s e E Each line has two characters separated by a space. The number of lines in the file is not known. Your function should transform the input string and put the result in the output string according to the following rules: If a character appears as the first character of a line in the file + Change it to the character that it maps to on that line of the file. For example for the above file: the character 'A' would be changed to'q. if a character does not appear as the first character of a line in the file + copy it as is (do not change). For example for the above file: the character 'B' is not mapped to any other character. Here are some examples(using the file above): input = "Seyed" is mapped to output = "sEyEd" input = "Adam's name." is mapped to output = "qdam's namE!" input = "Ascend." is mapped to output = "DEnd" The name of the function should be map Characters UsingFile. The signa- ture of the function should be: void mapCharacters UsingFile(char *fileName, char *input, char *output); Note: You would get a penalty of 25% if you read the contents of the file more than onceStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started