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
ddd [48]
3 years ago
15

Write and implement an interactive C program to scan and process a stream of words of a plain text. Your program should start wi

th an empty list of words. (Combinations of blanks, tabs, and newline characters to separate words.) After reading each word from the input stream, check the word for punctuation marks: if the first letter of the word is preceded or the last letter is followed by punctuation marks, delete punctuation marks from the word if a word contains punctuation marks in the middle, ignore the letters beyond these punctuation marks. For example, if the word is fish, (fish comma) then the resulting word should be fish however, if the word is fish_net then the resulting word would be fish.
Computers and Technology
1 answer:
Wittaler [7]3 years ago
5 0

Answer:

(c) A list of words

Explanation:First let's format the code properly

fin = open('words.txt')

for line in fin:

    word = line.strip()

    print(word)

Second, let's explain each line of the code

Line 1:

The open() function is a built-in function that takes in, as argument, the name of a file, and returns a file object that can be used to read the file.

In this case, the name of the file is words.txt. Therefore, the variable fin is a file object which contains the content of the file - words.txt

Line 2:

The for loop is used to read in each line of the content of the file object (fin).

Line 3:

Each line of the contents is stripped to remove any trailing and leading white spaces by calling on the strip() function. The result of the strip is stored in the variable word.

Line 4:

The content of word at each of the cycles of the loop is printed to the console.

Therefore,  the overall output of the program is a list of words where each word represents a line in the target file (words.txt)

You might be interested in
Help please not trying to fail
deff fn [24]

Answer:

B. Everywhere CFCI is not

8 0
3 years ago
Please don't guess answer for points!!
Irina-Kira [14]

Answer:

The answer is weak, Have a nice day! :)

Explanation:

D) weak

6 0
2 years ago
Read 2 more answers
Choose the statements that CORRECTLY describe a business organization.​
Kryger [21]

Answer:

An advantage to Corporations aI's a business organization is that they enjoy unlimited life and limited liability.

Explanation:

Unlimited life and limited liability are the major advantages of corporations.

Corporations have unlimited life unless all the shareholders decides to dissolve the corporation.

It has limited liability, it means that only the company assets will be sold in case of debt and investors are not liable to pay the debt.

3 0
3 years ago
Which recovery method allows users to back up their personal files to an external drive or network share without administrative
GarryVolchara [31]

Answer:

File history

Explanation:

File history recovery method  allows users to back up their personal files to an external drive or network share without administrative assistance. File History is a backup program that holds your personal files saved in the directories archives, desktop, favorites, and Contacts. It searches the file system regularly for changes, and copies modified files to a different location.

8 0
3 years ago
Can someone tell me what this means it’s on my phone and it’s not been working for days ASAP REPLYS THANK YOU
bixtya [17]
Plug it into your computer I think
7 0
3 years ago
Read 2 more answers
Other questions:
  • If your DTP document contains watermarks on every page, where can you place them?
    13·2 answers
  • Using features on demand results in saving potentially significant amounts of disk space. features on demand becomes a third ins
    14·1 answer
  • My computer have black spots and line
    7·2 answers
  • How does a spreadsheet affect a column of numerals when it sorts the column
    15·2 answers
  • Myles is studying a system to lessen the number of complaints about the Help Desk. He has formally studied the service counter a
    5·1 answer
  • 3. Write a program to find the area of a triangle using functions. a. Write a function getData() for user to input the length an
    10·1 answer
  • What is a device driver​
    13·2 answers
  • Why is monitor called softcopy output device?​
    6·1 answer
  • Which is NOT one of the basic characteristics of life? What feature of Microsoft
    5·1 answer
  • How are the waterfall and agile methods of software development similar?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!