Write a complete C++ program which consists of two parts. Part 1. Write a function which counts the number of y's in an array of chars. It takes two parameters: an array of chars called array, and the...


Write a complete C++ program which consists of two parts.<br>Part 1. Write a function which counts the number of y's in an array of chars. It takes two parameters: an array of chars called array, and the number of elements in the array<br>called size. It returns the number of elements in the array that are equal to 'y. You may assume that the parameters passed to the function are valid. Your function must have<br>the following signature:<br>int countYs (const char array[], int size)<br>Part 2. Write a simple main() function which demonstrates your function by doing the following:<br>- create an array of chars and give its elements some reasonable values.<br>- call your function to count the number of y's in the array, and output the returned value<br>

Extracted text: Write a complete C++ program which consists of two parts. Part 1. Write a function which counts the number of y's in an array of chars. It takes two parameters: an array of chars called array, and the number of elements in the array called size. It returns the number of elements in the array that are equal to 'y. You may assume that the parameters passed to the function are valid. Your function must have the following signature: int countYs (const char array[], int size) Part 2. Write a simple main() function which demonstrates your function by doing the following: - create an array of chars and give its elements some reasonable values. - call your function to count the number of y's in the array, and output the returned value

Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here