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
Pointer Arithmetic We can manipulate the pointers too. We can perform operations such as addition, subtraction, increment and decrement etc.,. As the pointer variables have add

Program to design list in c: Write a program in c to insert the values in list void main() { int i=0; char a[20]; clrscr(); printf("Enter the line\n");

Program is to store first n natural no in a file: Write a program to  store first n natural no in a file void main()     {     fstream file;     file.open("studen

Floating  literal They can be written in common decimal as well as scientific notation (floating point representation). By default it is of type double. F, L is applied only to

Variable Declaration This declaration of variables in the C language is permitted only in the starting of their block, prior to executable program statements. In C++ declaratio

Enumerated Constants Enumerated constants enable the creation of new types and then explain variables of these types so that their values are restricted to a set of possible va

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

For your class to work properly, you'll need to define appropriate constructors, extract and insert operators, and of course arithmetic operators. (If you wanted to use it as a gen

C Program for FUNCTION OF FIND THE FACTORIAL float factorial(float); void main() {           float i=0,c=0;           clrscr();           printf("ENTER THE DIGI

C++ improves on many of C's features and provides object-oriented programming capabilities used for software production, quality and reusability. C++ was developed by Bjarne Strons