Wednesday, October 24, 2012

Java Exercise #31: Count Letters

This program is to count the occurrences of each letter in an array.

Exercise: Write a program that generates 100 random lower case letters and then count the occurrence of each letter.


The lowercase letters are: 
m w u e b l g r p z v f h e n l u t c t 
e d k j k i r p a x g f p m v m x u c y 
w f b l k l k m w v c b l k s q a z h f 
g e v e p m v t g l j k u r b z k g q i 
s o z x y d f c n j u r c y j a l g q p 

The occurrence of each letter are:
3 a 4 b 5 c 2 d 5 e 5 f 6 g 2 h 2 i 4 j
7 k 7 l 5 m 2 n 1 o 5 p 3 q 4 r 2 s 3 t
5 u 5 v 3 w 3 x 3 y 4 z 

Download Code: Count Letters

No comments:

Post a Comment