C++ Assignment (send me a text file, need within the next 4 hours)
Write a program, using 25 or fewer lines of code, to count each occurrence of each lower-case letter in a string.
Start your program by declaring a character array, msg, with a size of 30 of greater.
<pre class="brush: cpp">
char msg[MAX];
</pre>
The user should then type a text string into the array:
<pre class="brush: cpp">
cin.getline(msg, MAX);
</pre>
Your program should now report the number of each character (a-z) found in the array:
a face at the beach
a - 4
b - 1
c - 2
d - 0
e - 3
f - 1
g - 0
h - 2
i - 0
j - 0
k - 0
l - 0
m - 0
n - 0
o - 0
p - 0
q - 0
r - 0
s - 0
t - 2
u - 0
v - 0
w - 0
x - 0
y - 0
z - 0
Here is one way of creating that output using characters in a loop:
<pre class="brush: cpp">
for (i=0; i<26; i++)
cout << static_cast<char>(i + 'a') << " - " << etc..
</pre>
8 years ago
10
Purchase the answer to view it

- code.cpp
- value of diversity
- CJS 240 Week 6 Assignment Corrections and Treatment
- ANT 101 Week 2 DQ 1 Foraging Societies
- Develop an application that allows the input, updating, and deletion of customers, homes, salespersons, and sales from your Reston Real Estate (RRE) Oracle database FA14-CMIS440-485 that you have been using since Project #2.
- homework
- Write a multiplication problem expression with a product of 5 to the 13th power
- Unit III Article Critique You are to choose an article from the CSU Online Library database. The article may cover a...
- HRM 310 Week 5 Implementing Change Report
- HCS 325 Week 1 Individual Roles and Functions Paper
- ASHFORD HCA 375 Week 4 DQ 2 Disclosure and Litigation
