Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

First, make a C program which reads the pairs of strings, source and destination and store them into the file dictionary.txt. The maximum length of

First, make a C program which reads the pairs of strings, source and destination and store them into the file dictionary.txt.

The maximum length of the strings is 32.

The first line of the input is N, the number of pairs. At the following lines i (i

The format of the dictionary.txt is as follows:

source(1)destination(1)

source(2)destination(2)

source(N)destination(N)

-------------------------------------------------------------

Then, read strings from standard input and translate the string using dictionary.txt and output the translated string. If the dictionary does not contain a string, the program should output the original string.

The program continue to try to translate the string until user input end.

------------------------------- For reference -----------------------------------

#include #include

#define MAX_STR 32

void makeDictionary() {

}

void translate(char* input, char* translated) {

}

int main() { // Implement readDictionary for Exercise 13-1 makeDictionary();

//// Uncomment the following block for Exercise 13-2 and implement transate function. // while (1) { // char input[MAX_STR]; // scanf("%s", input); // if (strcmp(input, "end") == 0) { // break; // }

// char translated[MAX_STR]; // translate(input, translated); // printf("%s ", translated); // }

return 0; }

image text in transcribed

\$./a.out 2 apple pomme pear poire apple pomme banana banana pear poire end \$

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases 11th British National Conference On Databases Bncod 11 Keele Uk July 7 9 1993 Proceedings Lncs 696

Authors: Michael F. Worboys ,Anna F. Grundy

1993rd Edition

3540569219, 978-3540569213

More Books

Students also viewed these Databases questions

Question

List fi ve diff erent types of project closeout.

Answered: 1 week ago

Question

4. Identify cultural variations in communication style.

Answered: 1 week ago