Question: C++ Exercise#3: Average characters Take Home Average Character of a C- String: Assume that the average character of a C- string is the character whose

 C++ Exercise#3: Average characters Take Home Average Character of a C-C++

Exercise#3: Average characters Take Home Average Character of a C- String: Assume that the average character of a C- string is the character whose ASCII value is the integer division of the total ASCII value of all characters of the string by the string's length. e.g.: The total ASCII value of the string, This is A test is 84+104+105+115+32+105+115+32+65+32+116+101+115+116 1237 and the length is 14, so the average ASCII value is the integer division of 1237 /14-88, ie.: X. Write a program that reads a string, calls the function averageCharactert) which finds the string's length, the sum ASCII value of the string, and the average character of the string. The program then prints the string's length and its average character. Sample input/output: nter a string: This is he string This is a Test" has 14, characters he average character charcter is X 5 15 a Test

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!