Question: /** * Problem 2: Intermediate Strings & Loops * * Given an input string, count the number of words ending in 'y' or 'z' -50

 /** * Problem 2: Intermediate Strings & Loops * * Givenan input string, count the number of words ending in 'y' or

/** * Problem 2: Intermediate Strings & Loops * * Given an input string, count the number of words ending in 'y' or 'z' -50 the 'y' in "heavy" and the 'z' in "fez" count, but not the 'y' in "yellow". Make sure that your comparison is not case sensitive. We'll say that a y or z is at the end of a word if there is not an alphabetic letter immediately following it. * * Do not use any string functions except for substr(), at(), and size(), and isalpha() from . * 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 This is the most difficult problem in the set, so do not start with this one. * ** Here are some other examples: "fez day" -> 2 "day fez" -> 2 "day fyyyz" -> 2 */ int endzy(const string& str) int result; // Add your code here return result; } xercise.cpp mn 1 #include 2 #include 3 using namespace std; 4 5 lint endzy(const string& str); 6 7 int main() 8 { 9 // Add any code you want to run here 10 // cout . * 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 This is the most difficult problem in the set, so do not start with this one. * ** Here are some other examples: "fez day" -> 2 "day fez" -> 2 "day fyyyz" -> 2 */ int endzy(const string& str) int result; // Add your code here return result; } xercise.cpp mn 1 #include 2 #include 3 using namespace std; 4 5 lint endzy(const string& str); 6 7 int main() 8 { 9 // Add any code you want to run here 10 // cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!