subject

A group of computer scientists wants to create a fixed-length compression algorithm. The simplest way to achieve compression is to use a fixed-length code generator. The idea behind this type of code generator is to assign a fixed-length bit sequence to each symbol of the alphabet. As part of this group of computer scientists, your goal is to write a program to determine the alphabet used by the message to be compressed (set of different characters in the input message), and the frequency of each symbol in the alphabet, using conditionals, loops, and arrays. Input:A sequence of character values representing the message to be compressed. The maximum number of characters in the input message is 100.Example: BBBCCE*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: BBBCCENumber of symbols in the alphabet = 5Characters in the alphabet = A, B,C, D,ENumber of bits per symbol = 3Histogram showing the frequency of the symbols in the alphabetA | B | ***C | **D | E | *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 11:00
Technician a says that the radiator usually cools better if the front air dam is removed. technician b says that when a condenser has a leak it can be repaired easily with epoxy. who is correct?
Answers: 1
question
Computers and Technology, 22.06.2019 15:00
Hyperactive media sales has 10 windows 7 laptop computers used by sales-people in the organization. each laptop computer has several customized applications that are used during the sales process as well as customer relationship management software. all of the applications on the laptops are difficult to configure and have large data files. if all of the laptops have current hardware, what is the easiest way to install windows 10 on them?
Answers: 1
question
Computers and Technology, 22.06.2019 15:10
Consider a direct-mapped cache with 216 words in main memory. the cache has 16 blocks of 8 words each. it is a word-addressable computer (rather than a byte-addressable computer which we normally discuss). (a) how many blocks of main memory are there? (b) what is the format of a memory address as seen by the cache, that is, what are the sizes of the tag, cache block, and block offset fields (if they apply)? (c) to which cache block will the memory reference db6316 map?
Answers: 1
question
Computers and Technology, 22.06.2019 17:20
[a] create a class called “cycle” which has two instance integer variables as properties, “numberofwheels” and “weight.” create a constructor with two parameters, using the same variable names in the parameter list. assign each variable to numberofwheels” and “weight” respectively. write a separate application to test the class and display its properties. note: do not change the names of the instance variables or the variables listed in the constructor’s parameter list. [b] edit your class cycle by adding a default constructor which will assign the default values of 100 to represent the numberofwheels, and 1000 to represent the weight, by invoking a call to the other constructor. modify your application created in [a] to test the class.
Answers: 3
You know the right answer?
A group of computer scientists wants to create a fixed-length compression algorithm. The simplest wa...
Questions
question
Chemistry, 29.08.2019 22:00
question
English, 29.08.2019 22:00
Questions on the website: 13722363