subject

Write a function named clonelines that takes two parameters:

1. infile, a string, the name of an input file that exists before clonelines is called
2. outfile, a string, the name of an output file that clonelines creates and writes to

the function clonelines reads the content of infile, line by line, and writes into outfile any line that contains at least one word that occurs more than once on the line. you may assume that the input file contains only lowercase letters, spaces and newline characters.

for example, if the following is the content of the file william. txt:

double double toil and trouble fire burn and caldron bubble

eye of newt and toe of frog fillet of a fenny snake in the caldron boil and bake

double double toil and trouble fire burn and caldron bubble

the following function call:

> > > infile = 'william. txt'

> > > outfile = 'clones. txt'

> > > clonelines (infile, outfile)

should create the file clones. txt with the content:

double double toil and trouble eye of newt and toe of frog double double toil and trouble

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:00
What is added to the < meta > tag to describe the encoding type?
Answers: 1
question
Computers and Technology, 22.06.2019 14:40
For this assignment you have to write a c program that will take an infix expression as input and display the postfix expression of the input. after converting to the postfix expression, the program should evaluate the expression from the postfix and display the result. what should you submit? write all the code in a single file and upload the .c file. compliance with rules: ucf golden rules apply towards this assignment and submission. assignment rules mentioned in syllabus, are also applied in this submission. the ta and instructor can call any students for explaining any part of the code in order to better assess your authorship and for further clarification if needed. problem: we as humans write math expression in infix notation, e.g. 5 + 2 (the operators are written in-between the operands). in computer's language, however, it is preferred to have the operators on the right side of the operands, ie. 5 2 +. for more complex expressions that include parenthesis and multiple operators, a compiler has to convert the expression into postfix first and then evaluate the resulting postfix write a program that takes an "infix" expression as input, uses stacks to convert it into postfix expression, and finally evaluates it. it must support the following operations: + - / * ^ % ( example infix expression: (7-3)/(2+2) postfix expression: 7 3 2 2 result: rubric: 1) if code does not compile in eustis server: 0. 2) checking the balance of the parenthesis: 2 points 3) incorrect postfix expression per test case: -2 points 4) correct postfix but incorrect evaluation per test case: -i points 5) handling single digit inputs: maximum 11 points 6) handling two-digit inputs: 100 percent (if pass all test cases)
Answers: 3
question
Computers and Technology, 22.06.2019 18:00
Determine whether the following careers would require training or college.
Answers: 1
question
Computers and Technology, 22.06.2019 21:30
After you clean an engine with hot water spray, it seems to stall; when it doesn't stall, it's idling noisily. technician a says to check for loose bolts on the flex plate near the torque converter. technician b says to wipe down the spark plug wires and the distributor cap. who is correct? a. technician a b. both technicians a and b c. technician b
Answers: 1
You know the right answer?
Write a function named clonelines that takes two parameters:

1. infile, a string, the...
Questions
question
Mathematics, 22.05.2020 23:05
question
Geography, 22.05.2020 23:05
question
Biology, 22.05.2020 23:05
question
Mathematics, 22.05.2020 23:05
question
Mathematics, 22.05.2020 23:05
question
Mathematics, 22.05.2020 23:05
Questions on the website: 13722359