Question: #include using namespace std; int main() { string id; //this string will store the last four characters of the id. cin>>id; //taking input the id

 #include using namespace std; int main() { string id; //this string

#include  using namespace std; int main() { string id; //this string will store the last four characters of the id. cin>>id; //taking input the id string answer="MYIDIS"; //this string will store the answer. for(int i=0;i 

here the code of Question 1 I NEED THE SOLUTION OF QUEASTION 2

Last digit 1243

3 1. Write a function that generates a string considering the last 4 - digits of your STUDENT ID. For example, if your ID is 134436, considering the last 4 - digits the program will generate the string "MYIDISFOURFOURTHREESIX". 2. Write a function that uses Huffman Coding to generate the Prefix Codes of the letters in the string 15 (ignore spaces) generated in Question-1. The functions in Question-1 and 2 will be in a single program and sequence of execution should look something like Figure 1. M: Step 11. Enter Student ID: 1344 Step 12. Generated String: MYIDISFOURFOURTHREESIX Step 3. Prefix Codes (Generated Using Huffman Coding): 1101 1100 011 1011 S: 0011 0010 0001 0000 010 1010 1001 E: 111 x: 1000 R: Figure 1: Generating Prefix Codes Using Huffman Coding. 3. Illustrate in a typed report, the sequence of generating Prefix Codes using Huffman Coding for the same string just to verify the output of your program in Question-2. 7 3 1. Write a function that generates a string considering the last 4 - digits of your STUDENT ID. For example, if your ID is 134436, considering the last 4 - digits the program will generate the string "MYIDISFOURFOURTHREESIX". 2. Write a function that uses Huffman Coding to generate the Prefix Codes of the letters in the string 15 (ignore spaces) generated in Question-1. The functions in Question-1 and 2 will be in a single program and sequence of execution should look something like Figure 1. M: Step 11. Enter Student ID: 1344 Step 12. Generated String: MYIDISFOURFOURTHREESIX Step 3. Prefix Codes (Generated Using Huffman Coding): 1101 1100 011 1011 S: 0011 0010 0001 0000 010 1010 1001 E: 111 x: 1000 R: Figure 1: Generating Prefix Codes Using Huffman Coding. 3. Illustrate in a typed report, the sequence of generating Prefix Codes using Huffman Coding for the same string just to verify the output of your program in Question-2. 7

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!