Computers and Technology

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

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 04:00, ittmanny6138
Laire writes a letter to her grandmother, in which she describes an amusement park she visited last week. she adds pictures of that place in her letter. which feature of a word processing program will claire to remove unwanted parts of the pictures?
Answers: 3
image
Computers and Technology, 23.06.2019 07:10, anika420
If you want to import a picture into a dtp application, what must you do first? draw an image frame. import text. open the folder containing the file. select get image… from the windows menu.
Answers: 2
image
Computers and Technology, 23.06.2019 21:00, tiffg2588
Will this setup result in what kathy wants to print?
Answers: 2
image
Computers and Technology, 23.06.2019 22:00, rocksquad9125
Take a critical look at three gui applications you have used—for example, a spreadsheet, a word-processing program, and a game. describe how well each conforms to the gui design guidelines listed in this chapter.
Answers: 3
Do you know the correct answer?
The coding language is c++, thank you so much! A sequence of character values representing the mess...

Questions in other subjects:

Konu
Social Studies, 31.01.2021 21:00
Konu
Mathematics, 31.01.2021 21:00