1 the strcmp function is one function that is available forthe comparison of strings 5346841

1. The strcmp function is one function that is available forthe comparison of strings. However, it provides very limitedinformation about how the string actually compare. (It simplyreturns the relative direction of one string to another.) Youare to rewrite the strcmp function to provide more detail. The minimum requirements for your strcmp function should be,

·          Itshould return a float value, NOT AN ARRAY, that expresses both therelative direction and distance of the second string in relation tothe first string. The first element should have a weight of1, the second element should have weight 1/26, and so on. Asan example, if the strings are “abc” and“bbc”, the function should return 1. If thestrings are “abc” and “zbc”, the functionshould return 25. If the strings are “abz” and“abc”, the function should return -.0325. Thevalue returned will never be less than -26 or greater that 26.

·          Youshould input the number of elements from the string that you wantto compare. If this number is larger than either of thestrings, you should limit the comparison to only the minimum of thetwo string lengths.

·          Yourfunction should ignore the case of the letter and stop thecomparison at the first punctuation mark or when the NULL characteris found.

·          Youmay use the strcmp function within your function.

"Get 15% discount on your first 3 orders with us"
Use the following coupon
FIRST15

Order Now