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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 05:00
Pls do you believe that the use of 3d animation has grown in feature films over the last few years? if so, do you think the trend will continue? what are the forces driving this trend?
Answers: 2
question
Computers and Technology, 22.06.2019 08:10
Ihave a music player on my phone. i can buy songs, add them to playlists and play them. obviously it would be redundant to store each song in each playlist; each playlist is just a list of pointers to the songs. for this lab you will simulate this behavior. your program will need to have options to: add songs to the system library (you will store the text of the first line of the song, rather than the audio) add playlists add songs to a playlist list playlists play a playlist list all of the songs in the library with a count of how many times each song has been played remove a song from a playlist remove a playlist remove a song from the library (and thus from all playlists that contain it) note that we will not be checking many error cases. in real programming this would be bad, you should usually try to recognize and respond to as many types of errors as you can. in the context of class we are trying to acquaint you with as many concepts as possible, so for the sake of educational efficiency we will not be checking most errors in this lab, you may assume that your user provides correct input. you may add all appropriate error testing if you wish, but we will not be testing for it.
Answers: 2
question
Computers and Technology, 23.06.2019 03:00
Jason, samantha, ravi, sheila, and ankit are preparing for an upcoming marathon. each day of the week, they run a certain number of miles and write them into a notebook. at the end of the week, they would like to know the number of miles run each day, the total miles for the week, and average miles run each day. write a program to them analyze their data. your program must contain parallel arrays: an array to store the names of the runners and a two-dimensional array of five rows and seven columns to store the number of miles run by each runner each day. furthermore, your program must contain at least the following functions: a function to read and store the runners’ names and the numbers of miles run each day; a function to find the total miles run by each runner and the average number of miles run each day; and a function to output the results. (you may assume that the input data is stored in a file and each line of data is in the following form: runnername milesday1 milesday2 milesday3 milesday4 milesday5 milesday6 milesday7.)
Answers: 3
question
Computers and Technology, 24.06.2019 07:30
Aproject involves many computing systems working together on disjointed task towards a single goal what form of computing would the project be using
Answers: 3
You know the right answer?
The coding language is c++, thank you so much! A sequence of character values representing the mess...
Questions
question
Computers and Technology, 02.06.2020 08:57
question
Mathematics, 02.06.2020 08:57
question
Physics, 02.06.2020 08:57
question
Mathematics, 02.06.2020 08:57
question
Biology, 02.06.2020 08:57
question
Mathematics, 02.06.2020 08:57
Questions on the website: 13722361