Advertisement
Guest User

Untitled

a guest
Apr 16th, 2022
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. /*Version 1*/
  5. void replace_word(char *word);
  6. void add_new_word_dictionary(void);
  7. void do_nothing(void);
  8. void return_basic(void);
  9. void check_word(void);
  10. void compute_words(void);
  11. void compute_characters(void);
  12. void compute_ch_sp(void);
  13. void compute_num_dif_words(void);
  14. void create_istogram(void);
  15. void save_file(void);
  16. int get_choice(void);
  17. char * add_text(void);
  18.  
  19.  
  20. int main()
  21. {
  22. int choice = 0;
  23. char string[40] = {"test"};
  24. while(choice = get_choice() != 5)
  25. {
  26.  
  27. get_choice();
  28. printf("your choice is %d",choice);
  29. if(get_choice()== 0)
  30. {
  31. add_text();
  32. }
  33. printf("The choice is %d",choice);
  34. }
  35. return 0;
  36. }
  37.  
  38. void replace_word(char *word)
  39. {
  40. printf("\n replace_word\n");
  41. return;
  42. }
  43.  
  44. void add_new_word_dictionary(void)
  45. {
  46. char word[50] = {"s"};
  47. printf("\nPlease enter the word\n");
  48. scanf("\n%s",word);
  49. printf("Your word is %s",word);
  50. return;
  51. }
  52.  
  53. void do_nothing(void)
  54. {
  55. printf("do_nothing");
  56. return;
  57. }
  58.  
  59.  
  60. void return_basic(void)
  61. {
  62. printf("\n return basic \n");
  63. return;
  64. }
  65.  
  66. void check_word(void)
  67. {
  68. printf("\ncheck word\n");
  69. return;
  70. }
  71.  
  72. void compute_words(void)
  73. {
  74. printf("\n compute_words \n");
  75. return;
  76. }
  77.  
  78. void compute_characters(void)
  79. {
  80. printf("\n compute characters \n");
  81. return;
  82. }
  83.  
  84. void compute_ch_sp(void)
  85. {
  86. printf("\n compute_ch_sp \n");
  87. return;
  88. }
  89.  
  90. void compute_num_dif_words(void)
  91. {
  92. printf("\n compute_num_same_words \n");
  93. return;
  94. }
  95.  
  96.  
  97. void create_istogram(void)
  98. {
  99. printf("\n create istogram \n");
  100. return;
  101. }
  102.  
  103. void save_file(void)
  104. {
  105. printf("\n save_file \n");
  106. return;
  107. }
  108.  
  109.  
  110. int get_choice(void)
  111. {
  112. int choice = 0;
  113. printf("\n Select a choice from the below \n");
  114. printf("\n Select 0 to add text \n");
  115. printf("\n Select 1 to add new words in the dictionary \n");
  116. printf("\n Select 2 to enter enter correction mode \n");
  117. printf("\n Select 3 to save the text \n");
  118. printf("\n Select 4 to see the statistics about your text \n");
  119. printf("\n Select 5 to exit the program\n");
  120. scanf("\n%d",&choice);
  121. return choice;
  122.  
  123. }
  124.  
  125.  
  126. char *add_text(void)
  127. {
  128. char word[40];
  129. printf("\n Add the word \n");
  130. scanf("\n%s",word);
  131. return word;
  132. }
  133.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement