Question: C programming (a) You will write a program that will do the following: prompt the user enter characters from the keyboard, you will read the

C programming
(a) You will write a program that will do the following: prompt the user enter characters from the keyboard, you will read the characters until reading the letter X' You will compute statistics concerning the type of characters entered. In this lab we will use a while loop. We will read characters from stdin until we read the character X'. Example input mJ0*5/]+x1@3qcxX The Xshould not be included when computing the statistics properties of the input. Since characters are integers you will determine the average character (average when one looks at the character as an integer (its ASCII value). To achieve this you will need to compute the sum of the ASCII values of the characters. We are interested in determining the following statistics 1. The number of lowercase alphabetical characters 2. The number of low digits 0''T, 2, 3, 4 3. The total number of characters inputted 4. The number of line feeds (ASCII value of 10) 5. The average character (here we treat the characters as an integer based on their ASCII values) and output the average (do not include X) 6. The average digit that is read 7. Number of times current character inputted equals preceding character inputted (b) You will write a main that declares an array of size 100. In the main you will call two functions int readData(int aR( 1), and int maxDigit (int aR[], int size). The function readData is such that using a while loop will read integers from the keyboard and store them in the array aR (that is passed to the function) In the second function maxDigit you compute the maximum digit of all the integers in the array. Here you look at the ones position of the integers and determine the maximum digit Example 23 max digit is 3 114 max digit is 4 197 maxdigit is 9
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
