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]
4 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]4 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
Let T be the statement: The sum of any two rational numbers is rational. Then T is true, but the following "proof is incorrect.
ikadub [295]

Answer:

the mistake is in the first statement.

Explanation:

Now lets us put the statement into consideration:

"The sum of any two rational numbers is irrational"

The negation is: " there exists a pair of rational numbers whose sum is irrational". (Existence of at least one of such a pair).

The negation is not "the sum of any two rational numbers is irrational"

Therefore the mistake is in the first statement and it is due to incorrect negation of the proof.

4 0
3 years ago
Which of the following is a set of short-range wireless technologies used to share information among devices within about two in
8_murik_8 [283]

Answer:

Option (c) NFC

Explanation:

  • The NFC Technology is a Wireless Technology which works in the range of 10 cm or less.
  • NFC stands for Near Field Communications.
  • The name itself indicates that it a communication mode with the near by objects.
  • The NFC technology is used in Access Cards, Payment Cards and Mobile Devices etc.
  • Option (a) IM - Instant Messaging is the instant text messaging technology sends and receives messages over the internet. It is used in Social Media where instant messaging is available. So, option (a) is not correct option.
  • Option (b) text messaging the technology is the technology in which the text messages are sent over the mobile networks ( in case of text messaging in mobile phones ) or over the internet ( emails, blogging etc). So, option (b) is not correct option.
  • Option (d) DES is not a short range wireless technology. So, option (d) is not correct.
  • Option (c) NFC is correct option.
3 0
3 years ago
There are 10 girls and 8 boys at a party. A cartoonist want to sketch a picture of each boy with each girl. How many sketches ar
kykrilka [37]
80 sketches will be required. It’s just multiplication. Let x=boys and y=girls. If x=8 and y=10, then one boy has to be with one girl. In total 1 boy will be with 10 girls, so that’s 10 sketches. You do the same for boy #2 and so on. It adds up to 80.
3 0
3 years ago
¿Cuál es el objetivo principal de los servicios?
sleet_krkn [62]
Ayudar a las personas que los contratan
8 0
3 years ago
write up a performance review for a fellow employee. Imagine you work in a shop and this is a fellow salesperson on the shop flo
son4ous [18]

Answer:

I'd give him the lowest performance review because who knows what he does, I mean, he is on the floor, not doing anything, especially not working.

8 0
3 years ago
Other questions:
  • Using a wireless network without the network owner's permission is known as ________.
    15·1 answer
  • What entity created the open systems interconnection (osi) seven-layer model?
    15·1 answer
  • When is a wrecker considered to be an emergency vehicle?
    12·1 answer
  • In the Word 2016 window, where is the Status bar located?
    11·1 answer
  • import java.util.Scanner; public class StudentScores { public static void main (String [] args) { Scanner scnr = new Scanner(Sys
    5·1 answer
  • An online travel agency such as Travelocity is an example of a(n) _____.
    14·1 answer
  • Software that tries to monitor and track the way you use your computer.​
    10·2 answers
  • What software application can be used to send and receive email messaging and management appointments in calendar's
    11·1 answer
  • Information technology student Roberta has been assigned a project on how to detect unwanted outgoing attacks. Which step is par
    12·1 answer
  • A user can add color to a database to highlight a modification. To do this with a macro, which command screen would you access o
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!