subject

Write a program that reads a given text file, outputs the text file as is, and also prints the number of lines and the number of times each letter appears in the text file. (to simplify things, treat uppercase letters and lowercase letters as being the same.)
create an array of 26 components to do the letter count for the 26 letters in the alphabet and a variable for the line count. (you may wish to call these variables lettercount and linecount respectively.)
hint: use the plan of declaring variables, opening input and output files, initializing the variables, reading and writing the character for each character in a line, incrementing the letter count, incrementing the line count, outputting line and letter counts and, finally, closing the input and output files. (you may wish to call the program outputting line and letter counts writetotal.)
create an ascii (or text) file that contains text that will be used as input to your program. call this file textinput.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:30
Working on this program in python 3.7: a year in the modern gregorian calendar consists of 365 days. in reality, the earth takes longer to rotate around the sun. to account for the difference in time, every 4 years, a leap year takes place. a leap year is when a year has 366 days: an extra day, february 29th. the requirements for a given year to be a leap year are: 1) the year must be divisible by 42) if the year is a century year (1700, 1800, the year must be evenly divisible by 400some example leap years are 1600, 1712, and 2016.write a program that takes in a year and determines whether that year is a leap year.ex: if the input is 1712, the output is: 1712 is a leap year. ex: if the input is 1913, the output is: 1913 is not a leap year. your program must define and call the function isleapyear(useryear). the function should return true if the input year is a leap year and false otherwise.
Answers: 1
question
Computers and Technology, 23.06.2019 00:20
The open systems interconnection (osi) reference model: defines standards for many aspects of computing and communications within a network. is a generic description for how computers use multiple layers of protocol rules to communicate across a network. defines standards for wireless local area network (wlan) communication protocols. details the advantages and disadvantages of various basic network cabling options.
Answers: 1
question
Computers and Technology, 24.06.2019 12:30
Why does the pc send out a broadcast arp prior
Answers: 1
question
Computers and Technology, 24.06.2019 15:00
Universal windows platform is designed for which windows 10 version?
Answers: 1
You know the right answer?
Write a program that reads a given text file, outputs the text file as is, and also prints the numbe...
Questions
question
History, 30.04.2021 22:30
question
Mathematics, 30.04.2021 22:30
question
Mathematics, 30.04.2021 22:30
question
Mathematics, 30.04.2021 22:30
Questions on the website: 13722363