HW2 1 - h andout# 4 I CsEl43-Computer P rogramming I...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
handout #4 CsEl43-Computer Programming II Programming Assign ment #2 due: Thursday, l0ll5l09, 9 pm In this programming assignment we will continue to practice using arrays and classes. You are to implement a class called Letterlnventory that can be used to keep track of an inventory of letters of the alphabet. The constructor for the class takes a String and computes how many of each letter are in the String. This is the information the object keeps track of (how many a's, how many b's, etc). It ignores the case of the letters and ignores anything that is not an alphabetic character (e.g., it ignores punctuation characters, digits and anything else that is not a letter). Your class should have the following public methods. Below is an example of how the add method would be called. Lett.erlnvent.ory inventoryl- = new Letterlnvent,ory("George W. Bush" ) ; Letterlnventory inventory2 = new Letterlnventory( "Barack Obama" ) ; Let.terlnventory surTr = inventoryl
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.
Ask a homework question - tutors are online