Input data analysis, C/C++ Programming

Create a class Word, representing a word. Two words should be considered equal if they consist of the same sequence of letters and we consider upper case and lower case as equal. For example hello, Hello and HELLO are considered to be equal. The methods equals and hashCode de ne the meaning of \equality". Thus, the class Word should look like the following.

public class Word implements Comparable {
private String word;
public Word(String str) { ... }
public String toString() { return word; }
/* Override Object methods */
public int hashCode() { "compute a hash value for word" }
public boolean equals(Object other) { "true if two words are equal" }
/* Implement Comparable */
public int compareTo(Word w) { "compares two words lexicographically"}
}
Note:
 If you want, you can add more methods. The methods mentioned above are the minimum requirement.
 Task 6 and onward is based on task 5. Thus, carefully test all methods before proceeding.

Posted Date: 3/14/2013 6:25:11 AM | Location : United States







Related Discussions:- Input data analysis, Assignment Help, Ask Question on Input data analysis, Get Answer, Expert's Help, Input data analysis Discussions

Write discussion on Input data analysis
Your posts are moderated
Related Questions

C program to reverse the elements of array: #define rows 3 #define cols 3 void main() {                 int i=0,j=0;                 int arr[rows][cols];

What do you mean by a sequential access file? - When writing programs which store and retrieve data in a file, it's possible to designate that file into various forms. - A s

give a program to accept and print 2_D Array



Example for Register Storage Class - computer programming? main() { register int i; for (i=0; i { ............... ............... } } /* block exit will free the register

Automatic Variables Automatic variables are variable which are explained within the functions. They lose their value when the function terminates. It can be accessed only in th

What is Ms dos?

Write a program that finds the minimum total number of shelves, including the initial one required for this loading process.