Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Int countChars(string input, char which_char) - Count the number of occurrences of a which_char in the input string Example: Input String: abcxyzl23zyz Char to count:

image text in transcribed

Int countChars(string input, char which_char) - Count the number of occurrences of a which_char in the "input" string Example: Input String: abcxyzl23zyz Char to count: z Count: 3 upperCaseChars - Given a string, return the number of uppercase characters. Use isupper from the cctype library. lowerCaseChars - Given a string, return the number of lowercase characters. Use islower from the cctype library.. numPunct - Given a string, return the number of punctuation characters. Use ispunct from the cctype library. StringToupper - Given a string as a parameter, return a new string converted to uppercase StringToLower - Given a string as a parameter, return a new string converted to lowercase characterCounts - Given a string, return a vector of ints of length 26 containing the number of times each letter was seen. Index 0 corresponds to 'a', 1 to 'b', etc... Treat upper-case letters lower-case. Do not use an if/else cascade or switch statements in the solution to this problem. numLines - Given a string, return the number of lines of text it contains. In UNIX, lines of text are delimited by the ' ' character. Note that a string of characters which does NOT include a is considered a single line. If the string ends with a ' \ then since there isn't anything after it, there isn't a new line. numWords - Given a string, return the number of words it contains. A word is defined to be a sequence of alphabetic (is alpha) characters with non-alphabetic characters on each side. If alphabetic characters start or end the string, they are considered a word. string rotateString(string to_rotate, int direction, int offset) - Rotate a string in the direction indicated by the number of characters indicated by the offset. If the offset is zero or string is empty or if the direction is invalid return the original string. Do not use the "rotate " function built into C++

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

Database And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 1 Lncs 13426

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124227, 978-3031124228

More Books

Students also viewed these Databases questions