Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ please Complete the main function and write a separate function called function that receives a string and three counters that the function will use

c++ please

image text in transcribed

Complete the main function and write a separate function called function that receives a string and three counters that the function will use to return to main the count of how many lowercase letters (a-z) are in the string, how many spaces are in the string and how many digits 0-9 are in the string. The string should be passed by value and the three integers should be passed by reference in the order stated above. HINT: Letters are in an ordered sequence like digits. So, for instance, 'a' is less than 'e' and 'e' is less than 'z'. Thus, any character not between a-z is not a lowercase letter. Be sure to use single quotes when you compare the character in the string, even when you are comparing the digits. Using a long series of if statements for each character in the alphabet or digit 0-9 will take too much time and will cause you to loose points. Make use of the && in your if statement to test for a range of values. 293816.1501062 LAB ACTIVITY 5.37.1: Lab4Quiz Part II 0/55 main.cpp Load default template... 1 #include 2 #include 3 using namespace std; 4. // include prototype here 5 int main() 6 { string astring; 7 int lettercounter-0,spacecounter-0-0, digitcounter=0; 8 // read a sentence from the keyboard (do not write a prompt to the user) 9 // call the function and pass it the sentence and the three counters 10 11 cout

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions

Question

The number of Estonian web sites exceeds 1 million.

Answered: 1 week ago