Exercise 2 - Course 67316 Programming Workshop in C Fall...

This preview shows page 1 - 2 out of 7 pages.

Course 67316 Programming Workshop in C – Fall 2013 Exercise 2 – Programming Section The solution of this exercise shall be submitted by Monday November 11, 2013 at 23:55. The course guidelines and instructions on program verification that were applicable in the first exercise are applicable in this exercise as well. 1. 3 short Programs (10 points each). Please include these files in your submission of this exercise. Comment your code extensively. You must use the README file that include with your submission to add comments on how you solved these exercises. a. Without using the library functions in string.h write a program that does the work of the strlen function. Look up how the strlen function works at this link: . The string is received as a command line parameter. The program shall be named MyStrLen. The program shall output on the line following the program invocation, the result which is the length of the string, followed by the newline character. If the input string length is greater than 25 characters the input is deemed invalid. The input shall have no spaces, there is no need to check this in your program. In the example below, following the program name is the string to be checked. On the following line is the length of the string. >MyStrLen roger 5 > >MyStrLen rogerkrogerkrogerkrogerkrogerk INVALID STRING TOO LONG! > Please name the code file MyStrLen.c b. Without using the library functions in string.h write a program that does the work of the strcmp function. Look up how the strcmp function works at this link: . The program shall be named mystrcmp. Following the program invocation the program requests the input strings, one after the other, on separate lines. The strings shall be less than or equal to 30 characters in size. Please use your own function like what you wrote in part a of this assignment to check the input string length. The strings do not have to be equal in size. The program shall output on the line following the program invocation the result followed by the newline character. The result is one of three outcomes (what is to be displayed is in quotes).
Image of page 1

Subscribe to view the full document.

Image of page 2
  • Spring '14
  • Hasheep
  • Data Structures, Filename, Filename extension, ASCII

{[ snackBarMessage ]}

Get FREE access by uploading your study materials

Upload your study materials now and get free access to over 25 million documents.

Upload now for FREE access Or pay now for instant access
Christopher Reinemann
"Before using Course Hero my grade was at 78%. By the end of the semester my grade was at 90%. I could not have done it without all the class material I found."
— Christopher R., University of Rhode Island '15, Course Hero Intern

Ask a question for free

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern