Write a Word Processor in C

Project: Write a Word Processor in C

Overview:

You have to create a Word processor using C programming. The program can accept a sentence of not more than 20 words.

The program is also able to perform the following functions:
(i) Reverse the whole sentence and print it out.
(ii) To identify how many instances of a specified character.
(iii) To return the position a specified character at the first occurrence.
(iv) To return the position a specified character at the last occurrence.
(v) To return the number of words in the sentence.
(vi) Reverse all the words in the sentence.

Hints:

  • You NEED to user 1-dimensional array or text to store the sentence .
  • You NEED looping statements to control the online menu.
  • Other C techniques you may user are:
  • if-else statement
  • switch-case statement
  • while/for/do-while statement

You should provide a menu for the user to choose the options.One possible sample of the menu is:

Word Processor
(1) Enter the sentence (max. 20 words)
(2) How many words in the sentence?
(3) Reverse the whole sentence from last character to the first.
(4) Find the number of the instances of character:
(5) Find the position of a specified character at the first occurrence.
(6) Find the position of a specified character at the last occurrence.

这是今天某位小伙伴分享的他们的课程作业题,
题目看起来似乎并不难,但想要写出健壮完美的程序,在具体实现的时候还是有很多细节要考虑到,下面贴出我自己简单实现的代码,代码中某些函数实现仍有待改进:

WordProcessor.c