Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a function void camelCase(char* word) where the argument word to the function camelCase(..) consists of at least two groups of lowercase alphabetic characters, not

Write a function void camelCase(char* word) where the argument "word" to the function camelCase(..) consists of at least two groups of lowercase alphabetic characters, not necessarily forming actual words in the dictionary, separated by underscores, such as ran_dom_word or "this_is_my_first_programming_assignment". The function camelCase(..) should remove underscores from the string and rewrite it in lower camel case (several words joined together where the first letter of the entire string is lowercase, but subsequent first letters are uppercase). Watch out for the end of the string, which is denoted by \0. Its possible that a user provided input string may contain uppercase alphabetic characters, numeric characters, special symbols, whitespace etc. as well. You should accept such an input string too. For convenience, convert the string into a valid form before you use it for the function camelCase(..). Below are some conversion examples of what you should implement - a) "_random_ _word_provided" should be converted to "random_word_provided" first, then finally to "randomWordProvided" using the function camelCase(..). b) "@$ptr*4con_" should be converted to "ptr_con" first, then finally to "ptrCon" using the function camelCase(..). c) " ran dom word" should be converted to "ran_dom_word" first, then finally to "ranDomWord" using the function camelCase(..). d) "example word " should be converted to "example_word" first, then finally to "exampleWord" using the function camelCase(..). e) "ANOTHER_Word" should be converted to "another_word" first, then finally to "anotherWord" using the function camelCase(..). f) One or more combinations from options a, b, c, d and e should be also taken care of. Examples of the strings that you must not allow as inputs are - "__", "_ _ _", " ", "435%7_$$", "random". Print invalid input string for such cases. You are allowed to limit the size of the input string you will provide. Finally, do not use the library functions isupper(..), islower(..) or strlen(..). Write the code on your own to perform such string operations if required

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions

Question

x-3+1, x23 Let f(x) = -*+3, * Answered: 1 week ago

Answered: 1 week ago