Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write the code in c++ and could you please write the int main and you could see if the code is working by trying the

image text in transcribed

image text in transcribedwrite the code in c++ and could you please write the int main and you could see if the code is working by trying the sample test case0 and 1 the output should be as same as the output in the photo

In this question you are required to complete a function that receives a C-String as a parameter then sorts its characters as alphabets or not. In more details, the function receives a group of characters in a C-String without spaces. The function is supposed to print out a single line that contains the following: - All alphabets (A-Z or a-z) in their order in the C-String followed by all other characters in their order in the C-String without spaces - Number of alphabets - Number of other characters - The word Higher or Lower or Equal There must a single space between each two items. The last word shows if the number of alphabets is Higher, Lower, or Equal than the number of other characters in the C-String. For example, if C-String inCS = "Pay100\$daily", the the output should be: Paydaily100\$ 84 Higher Do not write and submit the main subroutine, or any include statments, these are already written and hidden from you. However, if you want to test your solution in any IDE (e.g., CodeBlocks, CLion, onlinegdb.com), then you will need to write your own main there for testing purposes. IMPORTANT NOTES - Do not change the given functions header. - Do not add any cout statements in the function except for the final answer as specified above. - Do not add any unnecessary spaces and follow the same format regarding spaces and letters case. - Assume cstring and cstdlib libraries are already included. Sample Testcase 0: Input: Suppose main calls CStringSort as CStringSort("hi44gt\#@\$fef") Function Output: The function must print the following: higtfef44\#@\$75 Higher Sample Testcase 1: Input: Suppose main calls CStringSort as CStringSort("We22rt55") Output: The function must print the following: Wert2255 44 Equal

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

Spatial Databases A Tour

Authors: Shashi Shekhar, Sanjay Chawla

1st Edition

0130174807, 978-0130174802

More Books

Students also viewed these Databases questions