subject

The coding language is c++, thank you so much! A sequence of character values representing the message to be compressed. The maximum number of characters in the input message is 100.
Example: 2020cccbbba
Note: You must use a static array of characters to store the input message.
Output:
The input message (character array).
The number of symbols in the alphabet (integer value).
The symbols in the alphabet (characters separated by a comma). You must print the alphabet's characters based on
the order they appear in the input message.
The number of bits per symbol (integer value). To calculate the number of bits used per symbol, you will use the following formula: ceil(log2(number of symbols in the alphabet)).
A histogram showing the frequency of the symbols in the message (see the example below). You must print the information about the frequency of the symbols in the alphabet sorted in increasing order by their first appearance in the input message. Given the previous input, the output of your program must be:
Message: 2020cccbbba
Number of symbols in the alphabet = 5
Characters in the alphabet = 2,0,c, b,a
Number of bits per symbol = 3
Histogram showing the frequency of the symbols in the alphabet
2 | **
0 | **
c | ***
b | ***
a | *
NOTES:
You can only use conditionals, loops, and arrays when writing your solution. Using strings will translate into a 100% penalty for your solution.
The input message may have white spaces. Consider using getline instead of cin when writing your solution.
You must include the cmath library to use the ceil function and the log2 function

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 20:00, darlene93
An excel which cell contains =b2 is copied to row below, the same column. what will be the new cell's content
Answers: 2
image
Computers and Technology, 22.06.2019 19:20, manny2085
Amedian in the road will be marked with a white sign that has a black arrow going to the left of the median. true false
Answers: 1
image
Computers and Technology, 23.06.2019 19:30, carcon2019
Amitha writes up a one-page summary of a novel during her summer internship at a publishing company. when she reads over the page, she realizes she used the word “foreshadow” seven times, and she would like to reduce the repetition. which tool would best amitha solve this problem?
Answers: 3
image
Computers and Technology, 23.06.2019 20:30, summerhumphries3
What are some settings you can control when formatting columns?
Answers: 1
You know the right answer?
The coding language is c++, thank you so much! A sequence of character values representing the mess...

Questions in other subjects:

Konu
Business, 28.11.2019 22:31
Konu
Mathematics, 28.11.2019 22:31