Write a program to count each occurrence of each lower-case

Assignment Help C/C++ Programming
Reference no: EM132193449

Question: 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>

Reference no: EM132193449

Questions Cloud

Identify architectural issues with detailed explanation : Review the Enterprise Data Warehouse architecture shown in the figure (a) identify all possible architectural issues with detailed explanation?
Consistent cash flow for relatively new company : Spam Inc. has a quickly growing workforce of 200 full time employees. Spam has a consistent cash flow for a relatively new company.
Several presentations about customer lifetime value : You recently attended a marketing conference and listened to several presentations about customer lifetime value (CLV),
Explain the unique aspects of elementary students : Research two scholarly articles related to the role that language, culture, and diversity play in the learning process in the classroom.
Write a program to count each occurrence of each lower-case : 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.
What are the elements of an adverse event : What are the elements of an adverse event that a healthcare organization has the responsibility to disclose to the patient or to the patients family
Describe how emergency management has changed : Describe how emergency management has changed over the last 50 years in your community. Compare those years to that of the Post-Katrina era.
Enterprise environment for the application developers : It is common in an enterprise environment for the application developers to help the users test a product or test a change within the product.
Perform an up-front and on-going cost comparison : You are the IT manager of a start-up company. Your team has recently built a new Web service that requires a hosting environment comprised of multiple servers.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd