1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
irina1246 [14]
3 years ago
12

In this problem, you will write a translation program. First your program will prompt the user for three filenames. The first fi

le is a dictionary. Each line contains a regular English word followed immediately by a vertical bar ($\verb#|#$) followed immediately by the word or phrase that the word should be translated to. For example, if I wanted to translate $\verb#'hello'#$ as $\verb#'hola'#$, one entry in the file would be $\verb#hello|hola#$. The second file should contain a text to translate. You may assume that words in this file are separated by spaces and that there is no other punctuation (including periods at the ends of sentences). The last filename should be for an output file.
The program will then take each word in the input file and translate it based on the dictionary. In other words, if the word appears on the left side of a bar in the dictionary file, the program will replace it with whatever is on the right side of the bar. If the word does not appear on the left side of a bar, it is kept as is in the output. (Note, though, that you do not have to preserve case in the output---if a word is capitalized in the input, it does not have to be capitalized in the output.) All the words should be written to the output file. Other than prompting for the filenames, there should be no other output to the IDLE shell.

For example, using the provided files $\verb#pirateWords.txt#$ and $\verb#myInput.txt#$, a run of your program could look like this:
Enter name of dictionary: pirateWords.txt
Enter name of text to translate: myInput.txt
Enter name of output file: myOutput.txt

There should be nothing printed, and the contents of $\verb#myOutput.txt#$ would be:
avast i have come to swipe ye filthy lucre
ye filthy lucre or ye life
Computers and Technology
1 answer:
Mrac [35]3 years ago
6 0

Answer:

Ohh...................................................

You might be interested in
What tool can help discover and report computer errors when you first turn on a computer and before the operating system is laun
Vlada [557]

Answer:

a post diagnostic

Explanation:

4 0
3 years ago
Read 2 more answers
If someone you don’t know asks where you go to school, what should you do
My name is Ann [436]

Answer:

Don't answer him because you don't know what he is going to do

8 0
3 years ago
Write the definition of a method powerto, which receives two parameters. the first is a double and the second is an int. the met
mihalych1998 [28]
       
The case of x⁰=1 is one you shouldn't overlook!

double powerto(double f, int exponent)
{
            if (exponent < 0) { return 0; }
            if (exponent == 0) { return 1.0; }          
            while (--exponent > 0) { f *= f; }
            return f;
}
5 0
4 years ago
What are the 3 parts of a browser window? What componets are in each?
Helga [31]
Here are the universal symbols: the minus symbol is minimize, the square(s) are for windowed mode, and the X symbol is for closing the browser. Branliest answer here.
7 0
4 years ago
Cite 3 funções para o uso de uma Rede de Computadores
Andru [333]

Answer: Servidores, Clientela, Medios de transmisión

8 0
3 years ago
Read 2 more answers
Other questions:
  • Employees don't have to comply with PPE requirements if they feel the PPE isn't necessary for the particular task they performed
    14·2 answers
  • The Task Manager can be used ot track running _________________ .
    11·1 answer
  • Linela Insurance needs to hire twenty accountants immediately to support its accounts receivable process. The hiring and trainin
    7·1 answer
  • Which is a good guideline to follow for adding animation to a presentation?
    12·1 answer
  • Create a program that receives the age of a user and determine whether he/she can vote or not. Assume the voting age to be 20. C
    14·1 answer
  • What type of media is a hard disk​
    9·1 answer
  • An operating system that allows a single user to work on two or more programs at the same time is what type of OS?
    14·1 answer
  • Modern Computers compared to earlier computers are
    10·1 answer
  • If David wishes to digitally sign the message that he is sending Mike, what key would he use to create the digital signature
    15·1 answer
  • The _________________ can be used to repair common causes of unbootable operating systems. It is based on the Windows Preinstall
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!