Homework

Homework Questions? Ask a Tutor for Answers ASAP

Ask an Expert,
Get an Answer ASAP!

This answer was rated:

For LogicPro Only: Create an array based lookup table for…

For LogicPro Only: Create an array...
For LogicPro Only:
Create an array based lookup table for the following 48 C++ reserved words:
asm class double friend new return switch union
auto const else goto operator short template unsigned
break continue enum if private signed this virtual
case default extern inline protected sizeof throw void
catch delete float int public static try volatile
char do for long register struct typedef while
Use the following hash function to place the words into an array with 50 locations.
hash (key) = length (key) + value of first character + value of last character.
The character values are listed in the following table:
A = 11 E = 0 I = 13 M = 15 Q = 0 U = 31 Y = 40
B = 15 F = 15 J = 0 N = 13 R = 14 V = 10 Z = 0
C = 1 G = 23 K = 0 O = 0 S = 6 W = 26
D = 0 H = 15 L = 15 P = 25 T = 6 X = 0
Example: hash(“break”) = 5 + 15 + 0 = 20
Use Linear Probing for Collision Resolution with a step size of 1.
HashCpp Class
Define a C++ class named HashCpp that will manage the 48 C++ reserved words using an array based hash table implementation.
• The array consists of 50 addresses (0..49).
• The HashCpp class automatically performs the following operations when instantiated:
1. Initialize the hash table to empty
2. Read the 48 C++ reserved words found in a text file named res_words.txt one at a time and store them in the hash table (res_words.txt contains one reserved word per line).
• Once the hash table has been instantiated it can then be used to:
1. Search for a reserved word
 increment the element count when found
2. Display the contents of the hash table
Main Program
Write a complete C++ main/driver program that uses the HashCpp class to count the number of times each C++ reserved word appears in a text file. Read the file name from the user. Perform the steps listed below, then loop back to read and process another file until the user chooses to quit.
• The user specified file contains: C++ reserved words, C++ identifiers, and numeric constants.
• Read one line at a time from the user specified file.
• Scan the input line, character by character, stopping at the end of each word (reserved word or identifier) skipping over the numeric constants.
o Each line read from the user specified file will contain zero or more entries: words and/or numbers.
o All words start with a letter and end with either a blank space or the end of the current line/string.
• Search the hash table for each word that is discovered in the user specified file.
o If a reserved word is found, then increment the counter for that reserved word.
• After the user specified file has been fully processed output the table contents as shown below:
Output Format Requirements: (view) // display all 50 table entries in order 0..49
Address Reserved Word Count
14 goto 0 // “goto” does not appear in the user specified file
29 do 2 // “do” appears twice in user specified file
Show More
Show Less
Ask Your Own Homework Question
Answered in 6 minutes by:
3/28/2018
LogicPro
LogicPro, Engineer
Category: Homework
Satisfied Customers: 13,507
Experience: Expert in Java C++ C C# VB Javascript Design SQL HTML
Verified

Hi,

Welcome

Hope you are doing well.

Zip all files; upload the zipped file to http://wikisend.com or http://ge.tt and post download link here.

Ask Your Own Homework Question
Customer reply replied 4 months ago

I'm trying to upload my zipped file to http://wikisend.com, but I'm getting errors and it won't upload.

This is what I have on the .h file

#ifndef HASHCPP_H
#define HASHCPP_H

const unsigned LINE_SIZE = 80;

class HashCpp
{
private:
enum TableLimit { TABLE_SIZE = 50 };
struct TableNode
{
char element[LINE_SIZE + 1];
unsigned count;
};
TableNode hashTable[ TABLE_SIZE ];

unsigned hashElement( const char[] ) const;
unsigned convertChar( const char ) const;
void create(); // initialize hash table to empty
void fill(); // insert reserved words from file

public:
HashCpp ();
~ HashCpp ();
void find( const char[] );
void view() const;
};
#endif

Can you try again after removing spaces from the name

Zip all files including assignment with formatted text and any .h or .cpp file

Ask Your Own Homework Question
Customer reply replied 4 months ago

Here's the link

http://wikisend.com/download/630024/HashCpp.zip

Can you get to the file?

Yes. Thanks

deadline?

Ask Your Own Homework Question
Customer reply replied 4 months ago

Monday April 2nd at 11:59 pm

Thanks

Will have it ready

Ask Your Own Homework Question

Let me know once accepted

Thanks

LogicPro
LogicPro, Engineer
Category: Homework
Satisfied Customers: 13,507
Experience: Expert in Java C++ C C# VB Javascript Design SQL HTML
Verified
LogicPro and 87 other Homework Specialists are ready to help you
Ask your own question now
Customer reply replied 4 months ago

I accepted the offer

Thanks

Ask Your Own Homework Question
This answer is protected
Would you like to ask this question?
If you've already paid for this answer, simply Login.
Was this answer helpful?

How JustAnswer works

step-image
Describe your issueThe assistant will guide you
step-image
Chat 1:1 with a tutorLicensed Experts are available 24/7
step-image
100% satisfaction guaranteeGet all the answers you need
Ask LogicPro Your Own Question
LogicPro
LogicPro
LogicPro, Engineer
Category: Homework
Satisfied Customers: 13,507
13,507 Satisfied Customers
Experience: Expert in Java C++ C C# VB Javascript Design SQL HTML

LogicPro is online now

A new question is answered every 9 seconds

How JustAnswer works:

  • Ask an ExpertExperts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional AnswerVia email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction GuaranteeRate the answer you receive.

JustAnswer in the News:

Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.

What Customers are Saying:

Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help.

Mary C.Freshfield, Liverpool, UK

This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!!

AlexLos Angeles, CA

Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult.

GPHesperia, CA

I couldn't be more satisfied! This is the site I will always come to when I need a second opinion.

JustinKernersville, NC

Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around.

EstherWoodstock, NY

Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know.

RobinElkton, Maryland

He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here.

DianeDallas, TX

< Previous | Next >

Meet the Experts:

LogicPro

LogicPro

Engineer

13,507 satisfied customers

Expert in Java C++ C C# VB Javascript Design SQL HTML

Manal Elkhoshkhany

Manal Elkhoshkhany

Tutor

4,556 satisfied customers

More than 5000 online tutoring sessions.

Linda_us

Linda_us

Finance, Accounts & Homework Tutor

3,138 satisfied customers

Post Graduate Diploma in Management (MBA)

Chris M.

Chris M.

M.S.W. Social Work

2,699 satisfied customers

Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)

F. Naz

F. Naz

Chartered Accountant

2,194 satisfied customers

Experience with chartered accountancy

Bizhelp

Bizhelp

CPA

1,887 satisfied customers

Bachelors Degree and CPA with Accounting work experience

Seanna

Seanna

Tutor

1,781 satisfied customers

3,000+ satisfied customers, all topics, A+ work

< Previous | Next >

Related Homework Questions
For LogicPro only Implement the pattern-matching algorithm
For LogicPro onlyImplement the pattern-matching algorithm shown in the pseudo-code listing below. The 'slist' object in the pseudo-code is a map data structure. Most listings of this algorithm's use a… read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
13,507 satisfied customers
The program should read a file and create one single integer
The program should read a file and create one single integer for the FILE itself. Note that a file containing the word "joe" should hash to 679. If your program has not considered the fact that files … read more
Bruce Wilner
Bruce Wilner
Master of Engineering
30 satisfied customers
I need a question answered, Assignment5_1.java - Write a
Assignment5_1.java - Write a console program that follows the following: In the main () method, create an array of 1000 int. This means an array of type int that could store 1000 elements. Create a static method fillArray () that would accept an array of 1000 int as the only parameter and wouldinitialize them randomly in the range from 0 to 100. You can use static method java.lang.Math.random () to generate a single random Number of type double in the range from 0.0 to 1.0. You then may consider multiplying result returned by this method by 100 and round it to get an integer in the range from 0 to 100. Method fillArray () should be declared to return any data (for instance return data type should be void). Call method fillArray () from main () and pass declared array into it. No output is needed. Note: Since the type of data passed into the method is not the primitive data type (eg int, double, float, etc.) but an array, it will be passed by reference (in contrast to by value as we practiced in the previous assignment). In this case any modification made to array within method fillArray () will propagate to the original array which is declared in main (). Create a new static method getAverage () that accepts that same array of 1000 ints as the only method's parameter, calculates their average and returns it back to main () as a value of type double. Print that returned value in main (). Assignment5_2.java - Write to console Java program that does the following Read string text from a user and store it into a variable of type String Convert that string into an array of characters by using static method toCharArray () of class String. This method performs the conversion and returns an array of characters (type char) that you need to store in some temporal array, say char [] temp. Iterate through this temporal array and collect statistics of individual letter appearance. Then store that statistics in some other array called int [] stat. That new array needs to be declared to store statistical data of any possible character that can be seen in a user input. The general text includes letters of English alphabet (both small and capital cases), digits, and some punctuation marks (ie space, comma, period, dash, etc). If you think of "all possible characters", even those that are rarely seen in a typical English text, then you can not distinguish more than 128 different ones (see base ASCII table for example). In this case having stat array being declared to store 128 entries of type int is a good idea. Print out non-zero statistical data: a letter and a number in a single line, then another line, and so on. Example: Let's say a user has entered "Hello World !!!". This string contains 14 characters. Character 'H' is seen only once as stat value [72] would be 1 (number 72 is the index of 'H' in ASCII table). The value of stat [101] (letter 'e') is also 1, but for example, the value of stat [108] is 3 because 108 is the index of 'l' and there are 3 letters 'l' in the given Text line. Hint: In order to convert the value of character into ASCII code you can use data type casting. For example, assuming that array temp [] from the previous case study was populated with letters of " … read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
13,507 satisfied customers
Write a Java program that first reads an input text file,
Write a Java program that first reads an input text file, stores the prime numbers contained in the file in a hash table; second until the program is terminated, the program reads an input number from… read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
13,507 satisfied customers
According to research, we don't actually read every character
According to research, we don't actually read every character in a word, but rather recognize the words as a whole. As long as the first and last letters of each word are in place, the middle letters … read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
13,507 satisfied customers
Java Programming Write a console program that repeatedly prompts the u
Java Programming Write a console program that repeatedly prompts the user to enter data until they type done (any case, Upper, Lower, or Mixed). As they enter the data, assign it to a two-dimension ar… read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
13,507 satisfied customers
A college maintains a file of credit hours completed
A college maintains a file of credit hours completed for their students, named CREDITS.TXT.Each line of the file contains: the student's ID number (an 8-character string, containing 2 letters followe… read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
13,507 satisfied customers
write a program to manipulate strings using pointers. The program
write a program to manipulate strings using pointers. The program will start out by displaying a menu to ask user what to do as shown below: Simple String Manipulation Program Load string Show string … read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
13,507 satisfied customers
1. Write a java program to produce an array of integer random
1. Write a java program to produce an array of integer random numbers. Your program should find out from the user how many numbers to store. It should then generate and store that many random integers… read more
ATLProg
ATLProg
Sr Software Engineer
Master\u0027s Degree
46 satisfied customers
1. Create an array of type float with 10 elements. Write a
1. Create an array of type float with 10 elements. Write a modular program that does the following: Read values into the array representing salaries, Give everyone a 20% pay rise, Display the new sala… read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
13,507 satisfied customers
Hi I need the following answers for these questions 1.
Hi I need the following answers for these questions 1. Which of the following is not true with regards XXXXX XXXXX following statement? NAME=John+Doe&Serial=123456&System=M A. Data was collected via a… read more
Pete
Pete
Engineer
Bachelor\u0027s Degree
1,131 satisfied customers
1. Write a program that reads integers from the keyboard. If
1. Write a program that reads integers from the keyboard. If any of the numbers are negative, it returns a negative number. If all the numbers are positive, it returns their average. 2. Write a progra… read more
ehabtutor
ehabtutor
C.E.O
Bachelor\u0027s Degree
12 satisfied customers
The local realtors association keeps track of homes for sale
The local realtor's association keeps track of homes for sale in the area. The file (LISTINGS.TXT) contains the MLS listing number; the asking price; whether the listing is available, under contract, … read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
13,507 satisfied customers
This assignment has you work with using Heap Sort to sort the contents
This assignment has you work with using Heap Sort to sort the contents of a file. Instructions Download the files short.txt and long.t xt. Both files contain a list of random words in uppercase. The f… read more
Expert
Expert
1. Create an array of 26 components to do the letter count
1. Create an array of 26 components to do the letter count for the 26 letters in the alphabet and a variable for the line count. (You may wish to call these variables letterCount and lineCount respect… read more
ATLProg
ATLProg
Sr Software Engineer
Master\u0027s Degree
46 satisfied customers
Vb.netA,local high school needs a reservation application
Vb.net A,local high school needs a reservation application to keep track of seats that are reserved for the school plays scheduled throughout the year. Main Form — frmReservation A menustrip control w… read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
13,507 satisfied customers
Recall that the output file from week 1s program, CUSTOMERS.TXT,
Recall that the output file from week 1's program, CUSTOMERS.TXT, contained customer code and total of all utility charges, one customer per line: You will use another file named CUSTOMERS.TXT as the … read more
ATLProg
ATLProg
Sr Software Engineer
Master\u0027s Degree
46 satisfied customers
1. Submit a single Notepad file containing the source code
1. Submit a single Notepad file containing the source code for all the files of the lab to the Dropbox for Week 5. Your source code should use proper indentation and be error free. Be sure that your l… read more
ATLProg
ATLProg
Sr Software Engineer
Master\u0027s Degree
46 satisfied customers
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Show MoreShow Less

Ask Your Question

x