Tuesday, June 28, 2011

::::|| VU ||:::: Re: CS301_Assign_04

//This program displayes the ASCII code table as per USER requirement
//This program will help in playing with Upper cases and Lower cases as well as many more.
#include <iostream.h>
#include <conio.h>

main() //main function (***Started)
{
int iFrom=0,iTo=0, i, iRange; //Variable declarations
char c;
cout<<"Please Enter the Range for ASCII Codes : "<<'\n';
cout<<"Range From : ";
cin>>iFrom; //Getting a numaric value from the user
cout<<"Range To : ";
cin>>iTo; //Getting a numaric value from the user

iRange = (iTo)-(iFrom); //Calculating the total required number of iteration
for(i=0; i<=iRange; i++) //For LOOP (***started)
{
c = iFrom; //Value of iFrom passing to c
cout<<iFrom<<"<-Ascii "<<"("<<c<<")"<<'\t'; //Print on the screen (Tab uses to view all ASCII in one go)
iFrom++;
} //For Loop (###Ended)
getche();
} //Main (###Ended)

/*Program written by hussain (mc100--------)
because our respected sir asking us to make some functions by your own
So I will try to make some fuctions that may behave just like the C Library functions.. Inshallah;
Best of luck all the students
From 65 To 90 will give us all ASCII of UPPER case A to Z.
From 97 To 122 will give us all ASCII of LOWER case a to z.
From 48 To 57 will give us all ASCII of Numarics 0 to 9*/


On Tue, Jun 28, 2011 at 10:55 AM, ..::ISHFAQ::.. <mc100402092@vu.edu.pk> wrote:

اسلام علیکم ورحمتہ اللہ و برکاتہ

Plz Discuss CS301_Assign_04_Here

Some Important Question?

What is meant by frequency table?  ( Its means that how many times a character exists in the sentence like, there are u=2 in virtual university)

 

How to construct frequency table? ( see above and its creation is very simple as above)

 

What is ASCII Code Table and its use? (I have write a program in my 1st semester to see all the ASCII code and that .cpp file I have attached here. It is the numeric representation of each and every character or space bar or any key of the key board and its range is from 0-127 whereas the extended ASCII are from 0-255)

 

Huffman Tree:

What is meant by Huffman table? (Huffman table is nothing but just a frequency table)

 

How to construct Huffman table?(If you would like to ask how to construct Huffman tree than see........  )

 (Just like a binary tree. (i) Make nodes for each and every character and mark its frequency (ii) separate the nodes of same frequency (iii) make tree by using a blank root node (all process is available on the Lecture 25 nd 26 of handouts.)

 

Where Huffman table is used ? (No Huffman table but Huffman CODE..... to determine the Huffman Code some one have to mark all links with 1 to the right side of every node and with 0 to the left side of a node.... ON THE HUFFMAN TREE.... and then traverse from ROOT NODE up to the required character)

 
 

Huffman Code for each Character:(Described above to traverse from root node to the required node)

 

               

 

Huffman encoding of given Phrase: ("virtual University of Pakistan" in this sentence you have to put all the codes of specific character like code of v then i then r then t and so on)

 

 

ACSII encoding of given phrase (Just put all the ASCII code in order ... like ..... ASCII for v then i then r and so on.... ASCII can be taken to run the program I have attached named ASCII.cpp)

Attachment is the practical application of Huffman Amgorithm using C++ programming
for the given sentence"Welcome to Virtual University".
This program is for just learning purpose of Huffman Algorithm in practical.
It will be shared very soon.
Note : the attachment can not e considered as solution to assignment because Huffman code are varying for the same input data due to difference in Huffman Tree construction..
Best Wishes,
"...SUBHANALLAHI WABI HAMDIHI...SUBHANALLAH IL AZEEM..."
Muhammd Ishfaq
MCS 2nd Semester (PakPattan)


--
_______________________________________________________________________
This group is dedicated for the student of MCS 2nd Semester
Google Group : zavia-lms@googlegroups.com



--

Master of Computer Science (MCS)

2nd Semester, Virtual University


--
For study materials, past papers and assignments,
Join VU School at www.VusCool.com
and www.VUGuys.com
CoooL Virtual University Students Google Group.
To post to this group, send email to coool_vu_students@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/coool_vu_students?hl=en

No comments:

Post a Comment