i need help in coding this please

I am totally new to this site as i am also a beginner in c++. I need help in coding this please.

Write a C++ program that asks the user to enter as many words as he/she wishes. Every time that a
new word is entered, it will be stored in a file called infile. Once the user stops entering new words,
the program will apply 3 hash functions to each of the words. To this end, the program will read the
words stored in the file infile one by one and apply for each of them the 3 hash functions
mentioned below. The size of the hash table for each function will be the double of the number of
words entered by the user. The hash tables resulting from the application of the 3 hash functions will
then be inserted in a new file called outfile. The program will also insert in this file the number of
collisions resulting from the application of each hash function.
Hash function 1:
hash(key) = (number of characters of key * 5)
2 mod sizeHashTable
Hash function 2:
hash(key) = (sum of ASCII codes of every character in key) mod
sizeHashTable
Hash function 3:
hash(key) = (sum of ASCII codes of the characters next to every
character in key - number of characters of key) mod sizeHashTable
For this 3rd
hash function, it means that if the key is aTzM then we sum the ASCII codes of bUaN.
Hi,

i am also a beginner in c++


Could you move this to the beginner section then?

I need help in coding this please.


Well you must have something, post it - don't forget the code tags: Use the <> button in the format menu on the right

Hash functions are not exactly a beginners topic, so hopefully already have some experience with C++ (even a little?)
Topic archived. No new replies allowed.