Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help with this C program. Help me to do the memory sharing for this specific case. The database is a file. Essentially the programs
Please help with this C program. Help me to do the memory sharing for this specific case. The database is a file. Essentially the programs should work like this: // Ask user for input sentence in the first program //load that into shared memory // The second program will check a txt file to see if the word from the sentence are in the file. // If they are not it will load them back into the scared memory //The first program will ask the user if the words are spelled correctly // If they are load them into shared memory //The second program will add them to the dictionary // The number of world in the sentence, new words, and total worlds in the document will be loaded into the shared memory //The first program will print them Task 2: [60 Points] Write a simple C program that accepts the text from user and find how many words are not there in its dictionary. The implementation should be as follows: The first process should run in an infinite loop accepting for the text as a user input. The first process reads just one line at a time and then send the text to the second process. The communication between the 1st process and the 2nd process should be via memory sharing. The second process reads the text received from the first process and finds out: o Number of words in the user text O Number of words not matched in its database o Number of words matched in its database The second process then needs to send the message to the user displaying these: o Number of words in the user text O Number of words not matched in its database o Number of words matched in its database For all the new words that the second process could not find in its database, it should send the message to the user to check whether those words are misspelled or not. o Each new confirmed word should be added to its database. Please help with this C program. Help me to do the memory sharing for this specific case. The database is a file. Essentially the programs should work like this: // Ask user for input sentence in the first program //load that into shared memory // The second program will check a txt file to see if the word from the sentence are in the file. // If they are not it will load them back into the scared memory //The first program will ask the user if the words are spelled correctly // If they are load them into shared memory //The second program will add them to the dictionary // The number of world in the sentence, new words, and total worlds in the document will be loaded into the shared memory //The first program will print them Task 2: [60 Points] Write a simple C program that accepts the text from user and find how many words are not there in its dictionary. The implementation should be as follows: The first process should run in an infinite loop accepting for the text as a user input. The first process reads just one line at a time and then send the text to the second process. The communication between the 1st process and the 2nd process should be via memory sharing. The second process reads the text received from the first process and finds out: o Number of words in the user text O Number of words not matched in its database o Number of words matched in its database The second process then needs to send the message to the user displaying these: o Number of words in the user text O Number of words not matched in its database o Number of words matched in its database For all the new words that the second process could not find in its database, it should send the message to the user to check whether those words are misspelled or not. o Each new confirmed word should be added to its database
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started