Compute the number of words-lines in the input file

Assignment Help Computer Engineering
Reference no: EM132182799

A Word Count Program. This code should be written in python 3 and Include python comment for each code.

A common utility on word processors is a small program called "wc." This program analyzes a file to determine the number of lines and words contained in the document. Write your own version of wc.

Input: Two file names - one for the input file (infile) and one for the output file (outfile) Output: Print the total number of words and the total number of lines that were contained in the

input file (infile). This output should be printed to the output file (outfile) Your program must meet the following specifications:

1. Get the input and output file names from the user.

2. Use files for all input/output.

3. Compute the number of words/lines in the input file and print the result to the output file. 4. Document the program using Python comments.

Here is a sample run of the program.

>>> main() What file would you like to analyze? sonnet18.txt What file should the results be written to? output.txt Results have been written to output.txt

If you use the sample file sonnet18.txt provided, the output should look like this:

The file sonnet18.txt had: words = 117 lines = 16

This output should be printed to the given output file, not the screen.

Reference no: EM132182799

Questions Cloud

Discuss your experiences with bluetooth hacking : Discuss how they would envision the devices that they own working together and how that might be done in a secure manner.
Write a program that reads in from a file two month names : Write a C++ program that reads in from a file two month names, followed by the rainfall amounts for each month in that span of months.
Compression and analog to digital process : Without quantization is there any possibility of losing some amount of information in compression and analog to digital process?
Create and use a subroutine that takes single character : Create and use a subroutine that takes single character parameter and displays a count of the number of environment variables that start with the subroutine.
Compute the number of words-lines in the input file : Compute the number of words/lines in the input file and print the result to the output file. 4. Document the program using Python comments.
Why are wireless transmissions being lost in transit : For good measure, you also walk around the office space with your wireless analyzer to confirm that there are no significant dead zones or interference.
How do these two frequencies differ in use : WLANs operate in two of the three common unlicensed radio frequency bands. What are these two frequencies?
Explain fully how you obtained your solution : Without using a computer decrypt the following ciphertext which has been encrypted using an affine substitution cipher.
Examine the radio button for military veteran : Write a function that will examine the radio button for military veteran as well as the text field for age.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Write a java interface called priority

Write a Java interface called Priority that includes two methods: setPriority and getPriority. The interface should define a way to establish numeric priority.

  How large a problem can be solved in 1 second using an algo

Determine how large a problem can be solved in 1 second using an algorithm that requires f(n) operations, where each operation is carried out.

  Print a line containing that number of adjacent asterisks

For each number read, the program should print a line containing that number of adjacent asterisks.

  What steps are involved for implementing

What steps are involved for implementing sw $s0 , 0 ( $s1) instruction . Draw data path and control path for this instruction.

  Calculate the approximate bit rate and signal level

Calculate the approximate bit rate and signal level(s) for a 4.2 MHz bandwidth system with a signal to noise ratio of 170. In a peer-to-peer (P2P) network, Internet users that are ready to share their resources become peers and form a network. Descr..

  Explain the method to create a scheme for vb mail order

Explain the method to create a scheme for VB Mail Order

  Find an app that uses device capabilities to provide product

Find an app that uses device capabilities to provide a product that previously couldn't exist. Explain what makes this app important or innovative.

  Design a program that calculates the total ticket sales

The manager of a football stadium wants you to write down a program that calculates the total ticket sales after each game. There are four types of tickets box, sidelline, premium and general admission.

  Design a software for restaurants to use

Design a software for restaurants to use, in order for restaurants to come up with the shortesh path of getting to houses in the order the orders came in.

  Mean of a set of operators to be functionally complete

Are there sets of a single operator that are functionally complete?

  Program to print the chain of numbers

Write down the program that prints out the chains for numbers within the range which the user specifies. The length of each chain must be printed at the end of the chain.

  Write a mips program guess

Write a MIPS program guess which tries to guess what number you have chosen in as few guesses as possible. It can only ask you whether the number is less than some other number.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd