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

  Define a function that returns a stream of random numbers

Define a function that returns a stream of random numbers that uses this linear-congruential formula.

  What are the likely risks in the two examples

What are the likely risks in the two examples, and how can the chosen development life cycle model face the risks?

  How the main memory address format look

How the main memory address format look.

  Questioninternet protocol standards are devised throughout

questioninternet protocol standards are devised throughout the efforts of thousands of people all over the world --

  Discuss the ongoing responsibilities of security manager

What other components of security management, as outlined by this model, can be adapted for use in the security management model?

  Sql query to determine lowest, highest, average salary

Let's assume that we wanted to determine the lowest, highest, average and total number of the salaries by department in company. What SQL query would provide us this.

  What is the maximum amount of gold extracted

A gold processor has two sources of gold ore, source A and source B. In order to keep his plant running, at least three tons of ore must be processed each day. What is the maximum amount of gold extracted

  Perform a direct construction

Give a regular expression for each of the subsequent languages by performing a direct construction.

  Create an integer array of size 10 using malloc

Create an integer array of size 10 using malloc and populate it with random numbers between 500 & 1000.

  Questionbased on explanation in gps low firm business

questionbased on explanation in gps low firm business processes. generate a database for the gps law firm.you can use

  How to use the sort package available on most systems

For example, from the operating system. Explain how to use the sort package available on most systems in the stub just dis-cussed.

  Create a function that opens the file and returns a file

Create a function that opens the file and returns a file object. Program should prompt the user to enter a valid file name.

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