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: BBBCCE
Number of symbols in the alphabet = 5
Characters in the alphabet = A, B,C, D,E
Number of bits per symbol = 3
Histogram showing the frequency of the symbols in the alphabet
A |
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: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 23:30
Step 1: choose your topics review the project milestone reflections you submitted for modules 1 through 4. choose the one major idea or concept from each module that you feel most applies to your life. in addition, choose an important concept from module 5 that applies to your life. step 2: write your guidebook for each module: write a catchy headline that clearly and concisely sums up your chosen idea or concept write a brief explanation that includes a description of the concept, why it is important, and how it can be applied to your life to make a positive impact choose an exciting, powerful, or engaging image that illustrates your concept remember, you are writing one for each module, so you will have a total of five headlines, five descriptions, and five images. step 3: design your guidebook choose a format to present your digital guidebook. there are many 21st century tools available for creating and submitting your work in the online environment. for more information on tools your school uses, contact your instructor or visit the web 2.0 tools area.
Answers: 3
question
Computers and Technology, 22.06.2019 17:40
Consider the simple 3-station assembly line illustrated below, where the 2 machines at station 1 are parallel, i.e., the product only needs to go through one of the 2 machines before proceeding to station 2.what is the throughput time of this process?
Answers: 2
question
Computers and Technology, 22.06.2019 18:00
Determine whether the following careers would require training or college.
Answers: 1
question
Computers and Technology, 23.06.2019 00:30
Quick pl which one of the following is considered a peripheral? a software b mouse c usb connector d motherboard
Answers: 1
You know the right answer?
A group of computer scientists wants to create a fixed-length compression algorithm. The simplest wa...
Questions
question
Social Studies, 09.03.2021 19:00
question
English, 09.03.2021 19:00
question
Mathematics, 09.03.2021 19:00
question
Mathematics, 09.03.2021 19:00
question
Mathematics, 09.03.2021 19:00
question
Mathematics, 09.03.2021 19:00
Questions on the website: 13722360