Question: (100 points) Write a program that prompts the user to enter the name of a file. The program encoded sentences in the file and writes

 (100 points) Write a program that prompts the user to enter

(100 points) Write a program that prompts the user to enter the name of a file. The program encoded sentences in the file and writes the encoded sentences to the output file. Enter the file name: messages.txt Output: encoded words are written to file: messages.txt.swt The program reads the content of the file and encodes a sentence by switching every alphabetical letter (lower case or upper case) with alphabetical position i, with the letter with alphabetical position 25-. For example, letter a is at position 0 and after encoding it becomes letter (position 25). Letter m is at position 12, it becomes letter n (position 13) after encoding because 25-12 is 13 1. Name your program file encode.c. The output file name should be the same name as the input file but with an added extension of.swt. For example, if the original file name is abc.txt, the output file name is then abc.txt.swt. Assume the file name is no more than 100 characters. Assume the length of each line in the input file is no more than 100 characters. Assume the input file contains no more than 1000 lines. 2. In the program, you should include the following function. void line_switch (char s1, char *s2) The function expects s1 to point to a string containing the input as a string and stores the output to the string pointed by s2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!