Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Need help creating Frequency analysis.
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
JR




PostPosted: Tue Mar 23, 2004 9:05 am   Post subject: Need help creating Frequency analysis.

hey, the program i need to make is a program that reads some text and then makes out a table with the % of letters in all the words.
For example

There you go
then its gonna count the nunber of a..z and output the % of the letter in the words.

i know i should have a program to start but i cant start it.
Sponsor
Sponsor
Sponsor
sponsor
nate




PostPosted: Tue Mar 23, 2004 12:13 pm   Post subject: (No subject)

code:

var line : string
var letters : array 1 .. 26 of int

for z : 1 .. 26
    letters (z) := 0
end for

put "Enter a line to be Examined"
get line : *

for i : 1 .. length (line)
    if line (i) not= ' ' then
        letters ((ord ((line (i))) - 96)) := letters ((ord ((line (i))) - 96)) + 1
    end if
end for

for i2 : 1 .. 26
    put chr (96 + i2), " | ", letters (i2)
    delay(10)
end for

%You can work on the chart all u want i don't really care


The chart sucks but thats what you can work on.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: