• This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #70
    admin
    Keymaster

       

      Once the user enters string of text, I start with counting no. of sentences. Here is a pseudocode:

      //To count no. of sentences in a string of text//

      int noofsentences = 0;

      Start from the beginning of file (or string of text);

      If . or ! or ?

      noofsentences = noofsentences + 1;

      till EOF (end of text);

      return noofsentences;

      I know the above pseudocode is too elementary and might even not be without faults. Still seeking opinion if this is the way a programmer approaches. Is my approach to Readability lab needs any correctional advise.

      Update:

      
      
      #include <stdio.h>
      #include <cs50.h>
      #include <string.h>
      int main(void)
      {
          string enterword = get_string("input");
          for 
          int t = strlen(enterword);
          printf("%i\n", t);
      

      Once the user enters string (enterword), do I need to create an array that will store all the characters (or string of text) entered by the user or array is already created when the user enters string input?

       


      Reply


      https://edstem.org/us/courses/176/discussion/970891?answer=2200298[learn_press_profile]

    Viewing 1 post (of 1 total)
    • You must be logged in to reply to this topic.
    Scroll to Top