CyberArmy University | Open Source Institute | CyberArmy Intelligence & Security | CyberArmy Services & Projects

Programming Challenge 4


[Replies] [Reply] [View by Thread] [Help]
[Back To Programming]

Posted by Delta Cpt dopel On 2008-08-01 17:43:54

Delta CptDelta Cpt
Delta Cpt dopel


Here is a problem of easy to medium difficulty courtesy of sefo.
Difficulty - Easy
--Read in this text file /files/pub/5ab45453618c60c150720402355c6193/2%20stories.txt
--for each line multiply the line number by the number of characters in that line.
--return the line with the biggest coefficient
--return the line with the lowest coefficient

Bonus (My contribution to make this a little harder for those who may be getting bored.)
Difficulty - Medium

--For each character in the text file store the frequency with with it occurs in the entire text.
ex. 'This is my string!" Should result in
T = 1
h = 1
i = 3
s = 3
...
! = 1

--Print out all results to a sepreate file

NOTE-- I have note explicitly defined what parts of the program should be in functions/methods. Part of good coding practice is to develop this skill. You should always be thinking about each piece of code and how it might be useful elsewhere or for different types of tasks.




Replies:


Guest:
Subject:
Message:
Signature:
Optional Image Link:
http://

CyberArmy::Forum v0.6
Generated In 0.02842 seconds


About Us | Privacy Policy | Mission Statement | Help