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 would each byte represent in binary coded decimal

Convert each of the following signed binary byte representations to its equivalent base-ten representation. What would each byte represent in Binary Coded Decimal? Show your work step by step

  What are the indices of the parent and children of a node

A ternary max-heap can be represented using an array. What are the indices of the parent and children of a node at index i ?

  State the union and intersection of the 2 sets and the

part i demonstrate demorgans laws using a venn diagram. define 2 sets and a universal set within which the 2 sets

  Design greedy algorithm for making change after someone buys

Design a greedy algorithm for making change after someone buys some candy costing x cents and the customer gives the clerk $1.

  Converting fahrenheit to centigrade and centigrade

Change the value in the centigrade box by using the formula for converting Fahrenheit to Centigrade and Centigrade to Fahrenheit.

  Write a function senatorname

CS6020 Assignment: Write a function senatorName() that returns the names of the senators for a given state, i.e., the function takes a state as an argument and returns the names of the senators for that state in a vector

  What changes to the process would you recommend

What changes to the process would you recommend? What are the key design principles that govern the effectiveness of this process?

  Discuss the pros and cons of the two approaches

Discuss the pros and cons of the two approaches. The issues you should consider, among other& are efficiency (disk space and access time).

  What are some security concerns when using mobile code

Explain the following terms: boot sector virus, meme virus, stealth virus, multipartite, macro virus, script virus, and tunneling virus.

  Describe what a social engineering attack is

Describe what a social engineering attack is, How can social engineering attacks be defended against

  Expand or contract the number of phases

What is the Software/System Development Life Cycle (SDLC) and can we expand or contract the number of phases depending on the particular project?

  Explain key elements of disaster recovery plan to be used

Explain the key elements of the Disaster Recovery Plan to be used in case of a disaster and the plan for testing the DRP.

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