Question: Hello, can you please translate this from java to C++. Thank you in advance. Problem: Given a string, count the number of words ending in

 Hello, can you please translate this from java to C++. Thank

Hello, can you please translate this from java to C++. Thank you in advance.

Problem: Given a string, count the number of words ending in 'y' or 'z' -- so the 'y' in "heavy" and the 'z in "fez" count, but not the 'y' in "yellow" (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. (Note: Character.isLetter(char) tests if a char is an alphabetic letter.) er(char) countYZ(fez day")-2 countYZ(day fez") 2 countYZ(day fyyyz") 2 Solution: 01public int countYZ (String str) { 02 int len - str.length(); 03 int count = 0; 04 str -str.toLowerCase(); 05 06 for (int i -0; i

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!