Assignment
Language is C++. any help is appreciated, thank you!
Write a program called CountElements that does the following:
· Declare a char array called sentence of 40 elements and assign the following: (I have noted the spacing)
How(sp)is(sp)Course(sp)1,(sp)C++,(sp)going(sp)4(sp)u?
· Declare counters that will count the number of elements that are:
alphabetic, digits, upper case, lower case, punctuation and spaces
(ex: numalph=0, numdig=0, etc)
· Loop through each character in the array and increase the proper counter.
Write the lines to determine each of the outputs.
Output: alphabet letters:
digits:
etc.
(ex: while (sentence [count] != ‘\0'))
Run the program. Print the code and a screenshot.
Sample Output:
alphabet letters: 18
digits: 2
upper case: 3
lower case: 15
spaces: 7
punctuation: 5
Press any key to continue . . .