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 are the best apps to learn coding
Soloha48 [4]
Khan Academy is a good website and also has an app
6 0
3 years ago
Read 2 more answers
Mention how to install antivirus software in your computer, either by following the instructions given on installation CDs or we
Tema [17]

Answer:

ionow please help me

Explanation:

5 0
3 years ago
Page _____ refers to whether a page is laid out vertically or horizontally.
Nostrana [21]
Page orientation is the answer and can you please help me with my java questions
8 0
4 years ago
The word biodegradable on a label doesn't necessarily mean a product is environmentally safe?
Flura [38]

Answer:

Biodegradable means it SHOULD be safe for the environment. Meaning it can break down into natural elements. However, this is uncertain as some materials don't break down as easily, with a possibility of not having much of a difference as non-biodegradable materials. It all depends on the product, but if we're going by the label, then by definition it's environmentally safe.

7 0
3 years ago
The input stream of a stack is a list of all the elements we pushed onto the stack, in the order that we pushed them. If the inp
Sidana [21]

Answer:

Push Z

Push Y

Pop Y

Push X

Pop X

Push W

Push V

Pop V

Push U

Pop U

Pop W

Pop Z

Push T

Push S

Pop S

Push R

Pop R

Pop T

Explanation:

A stack is a term in computer science that defines an abstract data type that acts as a collection of elements. It has two operations which are mainly push and pop.

Push is used in adding elements to the collection, while pop is used in removing elements from the collection.

If the element A has been pushed to the stack, you check if the top element in the pop[] sequence is A or not.

If it is A, you then pop it right, else top of the push[] sequence will be changed and make the sequences invalid.

So, similarly do the same for all the elements and check if the stack is empty or not in the last.

If empty you then print True else print False.

4 0
3 years ago
Other questions:
  • PLEASE HELP PROGRAMMING WILL GIVE BRAINLIEST
    6·1 answer
  • Interpersonal skills are extremely important in production management. true or false
    10·1 answer
  • Explain what might happen if two stations are accidentally assigned the same hardware address?
    15·1 answer
  • Three healthcare firms jointly own and share the same cloud resources to meet their computing needs. Which cloud model does this
    15·1 answer
  • For example, sumDigits(234) returns 9 (= 2 + 3 + 4). (Hint: Use the % operator to extract digits and the / operator to remove th
    15·1 answer
  • How could a system be designed to allow a choice of operating systems from which to boot? What would the bootstrap program need
    14·1 answer
  • Mike's boss told him he needs to be more efficient. Select each suggestion that will help him become more efficient at creating
    9·1 answer
  • Although heart rate increases and decrease depending upon activity level on average a typical person heart rate is about _____ b
    10·1 answer
  • In the context of a global information system (GIS), _____ networks offer electronic data interchange standards, encryption, sec
    10·1 answer
  • After you configure backup settings using the backup plugin, backup jobs will run automatically and start taking backups at the
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!