Write a c function which prints a frequency histogram

Assignment Help Computer Engineering
Reference no: EM132194482

Question :

Write a C function which prints a frequency histogram of words in a given sentence.

The words in the given string may contain a mixture of lower and upper case letters in which case your function should be able to identify them and treat as the same words.

For example, the words "Happy", "happy" and "HAPPY" are all the same. You can assume that all words are separated by single spaces and each word can contain at most 10 characters.

Each line of your output histogram should contain a unique word in a column that is 10 characters wide, followed by a number of "+" signs equal to total occurrence of that word in the given sentence. The function should have the following prototype:
void printFrequencyHistogram(char * sentence);

Sample input strings and outputs are as follows.
char sentence1[] = "I am the ONE and only one and I am who I am";
printFrequencyHistogram(sentence1); // should print as below:

I +++
am +++
the +
one ++
and ++
only +
who +

Reference no: EM132194482

Questions Cloud

Display the median of the grades : Write a C# console program that asks the user how many grades there are, inputs the grades, and displays the median of those grades.
Find the current through a loop : Find the current through a loop needed to create a maximum torque of 9.4 N · m. The loop has 43 square turns that are 19.1 cm on a side and is in a uniform.
Poor communication and poor management development : How to complete an implementation schedule to improve team work, poor communication and poor management development?
Calculate the de broglie wavelength of the bullet traveling : A certain rifle bullet has a mass of 6.45 g. Calculate the de Broglie wavelength of the bullet traveling at 1169 miles per hour.
Write a c function which prints a frequency histogram : Write a C function which prints a frequency histogram of words in a given sentence.
General health care fraud prevention and enforcement : Visit the Office of Inspector General Health Care Fraud Prevention and Enforcement Action Team (HEAT) Provider Compliance Training Web page
How long will it take you to catch him : On one side of the paper solve it using position versus time graphs and on the back side solve it with velocity versus time graphs.
Print the appropriate messages if the user enters wrong : Write a C++ program which accepts username and password from user and then print on the screen whether the user is authenticated or not.
Create new vectors - one to hold the odd integers : Create 2 new vectors - one to hold the odd integers and one to hold the even integers. Display the contents of both vectors.

Reviews

Write a Review

Computer Engineering Questions & Answers

  What happens if for some unknown reason

What happens if, for some unknown reason, all the permits disappear? How can this event be detected? How can this event be repaired?

  Demonstrate an understanding of various uses of cryptology

Demonstrate an understanding of the various uses of cryptology. Differentiate between asymmetric and symmetric encryption.

  List and describe what is available at five web sites

Using a Web browser, search for the term CERT. List and describe what is available at five Web sites?

  Provide a definition of the exp function

E19: Numerical Methods for Engineering Applications Spring 2016 - HOMEWORK 9. In either case, you will need to provide a definition of the exp function which handles dual numbers correctly (see sqrt and cos in dual.py for examples)

  Create a text file called scores.txt with notepad

Create a text file called scores.txt with notepad with two lines: the first two lines are the computer scores and the second line human scores.

  Make a plan to deploy several visual basic.net

Your supervisor has asked you to develop a plan to deploy several Visual Basic.NET applications to users in your company. Discuss the important considerations in this effort and give a summary of the technical approach you would use to deploy thes..

  Create an application that displays the given patterns

Create an application that displays the following patterns. You may use any character of your choice to construct the pattern. One possible solution follows.

  Choose third-party control available for visual basic.net

choose a third-party control available for Visual Basic.NET. Discuss how this control is used in an application. What are the advantages and disadvantages of using third-party controls in your applications.

  Draw a representation of an initially empty array list a

Draw a representation of an initially empty array list A after performing the following sequence of operation: add(0,4), add(0,3), add(0,2), add(2,1), add(1,5).

  Discuss mainstream von neumann architectures

The 68020 microprocessor has almost the same instruction set as its predecessor. the 68000, and yet represents a giant leap forward in terms.

  Describe detail of object type and relationship shown on erd

Does the ERD show the reader any information about the functions. Where should we describe the details of object types and relationships shown on the ERD?

  What is the modulus of elasticity

Consider the power transmission-line tower shown in the accompanying figure. The members have a cross-sectional area of 10 in2 and a modulus of elasticity of E.

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