5) Write a program to read text to end-of-file, and print a count of word lengths, i.e. the total number of words of length 1 which occurred, the number of length 2, and so on. Define a word to be a sequence of alphabetic characters. You should allow for word lengths up to 25 letters. A typical output should be like this: length 1 : 10 occurrences length 2 : 19 occurrences length 3 : 127 occurrences length 4 : 0 occurrences length 5 : 18 occurrences

Answers

Answer 1

Answer:

Explanation:

The following code is written in Python. It is a function that takes in the name of the file to be read and the size of the word. Then the function reads the file, removes whitespace and commas, splits the text into words, and scans the words for all the words that have the same length as the number passed. It counts all those words and prints out the number of occurrences of words of that length.

def countOccurrences(file_name, word_size):

   f = open(file_name, 'r')

   text = f.read()

   text = text.replace(',', '')

   split_text = text.split(' ')

   occurrences = 0

   for word in split_text:

       if len(word) == word_size:

           occurrences += 1

   print("Length 1: " + str(occurrences) + " occurrences")

5) Write A Program To Read Text To End-of-file, And Print A Count Of Word Lengths, I.e. The Total Number

Related Questions

Draw a data flow diagram that indicates the condition and factors that must be satisfied before a customer request for goods can be granted from a factory

Answers

Skies in here and the beach and

PLZZ HELP!!!
Select the correct answer.
Brian’s team has built a new application based on the client’s requirements. They will deploy this application in multiple locations on the client side. Brian is unsure about the hardware and software specifications at the client side. Which option will help him best solve this issue?
A.
creating multiple test scripts
B.
automating test scripts
C.
creating multiple test plans
D.
creating multiple test environments
E.
communicating with the development team

Answers

Answer: Option D creating muiltiple test enviroments

Explanation: I had the same question and I hope this helps ( :

The option that will help Brain best solve this issue is by creating multiple test environments.

What is the specification of software?

A software requirements specification (SRS) is known to be a type of requirement that are often written in a document that tells more about what the software can do.

Hence in the above scenario, what will help help Brain best solve this issue is by creating multiple test environments where the client can see a demonstration and be convince in getting the product.

Learn more about application from

https://brainly.com/question/24847617

what is information richness

Answers

Information Richness is the ability of information to change understanding within a time interval.

Hope it helps. Have a great day.

Brainliest would be greatly appreciated.

___________________________________________________________

#SaveTheEarth

#SpreadTheLove

- Mitsu JK

Q3: State whether each of the following is true or false. If false, explain why. 1. A generic method cannot have the same method name as a nongeneric method. 2. All generic method declarations have a type-parameter section that immediately precedesthe method name. 3. A generic method can be overloaded by another generic method with the same methodname but different method parameters. 4. A type parameter can be declared only once in the type-parameter section but can appearmore than once in the method’s parameter list. 5. Type-parameter names among different generic methods must be unique. 6. The scope of a generic class’s type parameter is the entire class except its staticmembers.

Answers

Answer:

3

Explanation:

PLEASEE HELPP.... QUESTION... how does coding impact your life​

Answers

Answer: It allows us to do everyday tasks on the internet

Explanation: We wouldn’t be able to email, research, etc without coding!

It helps us use things such as the internet, TVs and many other things coding is a Vidal asset in are everyday life.

When using for loops and two-dimensional arrays, the outside loop moves across the ___________ and the inside loop moves across the ___________.

indexes, elements

columns, rows

elements, indexes

rows, columns

Answers

Answer: rows, columns

Explanation: :)

Is this correct? I say its B, but my friend says its D.

Answers

The answer is B, best of luck!

You have an audio that contains one pause for 0.2 seconds and another one for 0.6 seconds. When do you need to create a new segment?

Answers

A new segment should be created when there is a pause for more than 0.5 seconds

Introduction to Programming Workbook
Draw flowchart to find the largest among threu different numbers entered by a user

Answers

Haije jiôes 1w mòé si aimx

Read the following statements and use the drop-down menus to identify which statements are
conditional statements.
I am thinking about going to college.
I plan to go to college if my grades are good enough.
If my grades are very good, then I will select a college that offers scholarships.
I plan to visit several colleges to see what they offer and what the living situations look like.
If I do not qualify for any scholarships, then I will apply for student loans.
I will also start working a part-time job to help pay for college.

Answers

Answer:

I am thinking about going to college.

✔ not a conditional statement

I plan to go to college if my grades are good enough.

✔ conditional statement

If my grades are very good, then I will select a college that offers scholarships.

✔ conditional statement

I plan to visit several colleges to see what they offer and what the living situations look like.

✔ not a conditional statement

If I do not qualify for any scholarships, then I will apply for student loans.

✔ conditional statement

I will also start working a part-time job to help pay for college.

✔ not a conditional statement

If I go to college, then my parents will let me take the extra car with me.

✔ conditional statement

If I do not go to college and stay home, then my parents want me to start paying rent.

✔ conditional statement

Answer:

These are correct!

I am thinking about going to college.  ✔ not a conditional statement  

I plan to go to college if my grades are good enough. ✔ conditional statement   

If my grades are very good, then I will select a college that offers scholarships. ✔ conditional statement  

I plan to visit several colleges to see what they offer and what the living situations look like. ✔ not a conditional statement  

If I do not qualify for any scholarships, then I will apply for student loans. ✔ conditional statement 

I will also start working a part-time job to help pay for college. ✔ not a conditional statement  

If I go to college, then my parents will let me take the extra car with me. ✔ conditional statement  

If I do not go to college and stay home, then my parents want me to start paying rent. ✔ conditional statement

Explanation:

They are correct! I answered them and got them all right!

the process of preparing and setting up a software on a computer is called​

Answers

Answer:

installation

Explanation:

Installation (or setup) of a computer program (including device drivers and plugins), is the act of making the program ready for execution.

PLZZZ HELP
Select the correct answer.
A company utilizes a specific design methodology in the software design process. They utilize concepts of encapsulation in design. Which design methodology would they be using?
A.
structured design
B.
modular design
C.
object-oriented design
D.
rapid application development
E.
use-case design

Answers

Answer:

C is object-oriented design

Which option is the default configuration of the Junk Email Options in Outlook 2016?

No Automatic Filtering
Low
High
Safe Lists Only

Answers

Answer:

No Automatic Filtering

Answer:

NO automatic filtering

Explanation:

i took the quiz

Why data mining is crucial for the success of a business, explain with examples

Answers

Answer:

For businesses, data mining is used to discover patterns and relationships in the data in order to help make better business decisions. Data mining can help spot sales trends, develop smarter marketing campaigns, and accurately predict customer loyalty.

Digital computers use a........ system to encode date and programs.

Answers

Answer:

Digital computers use a binary system to encode date and programs.

For questions 3-6, consider the following two-dimensional array:

undervalue

will

knitting

pretzel

realize

honey

planetary

bandana

iron

employment

effort

fabric


What word is in [0][1] ?


Flag this Question
Question 41 pts
What word is in [1][1] ?

Flag this Question
Question 5
What word is in [3][2] ?

Flag this Question
Question 6
What word is in [2][1] ?

Answers

Answer:

3. Will

4. Realize

5. Fabric

6. Bandana

Realize is in is in [1][1], Fabric is in [3][2], Bandana is in [2][1] . Arrays inside of arrays are what are known as two-dimensional arrays.

What is two-dimensional array?

Arrays inside of arrays are what are known as two-dimensional arrays. 2D arrays, which are made up of rows and columns, are constructed as metrics. To create a database that resembles the data structure, 2D arrays are frequently used.

You may store a large amount of data using 2d arrays at once, which can then be supplied to as many different functions as necessary. Two indices are used to refer to the position of the data element in two-dimensional or multi-dimensional arrays. Row and column are the two dimensions indicated by the name. Realize is in is in [1][1], Fabric is in [3][2], Bandana is in [2][1] .

Therefore, realize is in is in [1][1], Fabric is in [3][2], Bandana is in [2][1].

To know more about two-dimensional array, here:

https://brainly.com/question/30463245

#SPJ3

Does anyone have the answers to edhesive 4.2 lesson practice I’ve been stuck on it for like 3 months

Answers

Answer:

1. 5, 10

2. 5, 7, 9, 11

3. 21

4. 10

Explanation:

personal computer is the rise of what?​

Answers

Answer:

Overuse injuries of the hand.

Obesity.

Muscle and joint problems.

Eyestrain.

Behavioural problems including aggressive behaviour.

Why is it important to think about the programming language to use?

Answers

Answer:

"The choice of programming language determines the type of game you can make."

Explanation:

Programming language enables us to write efficient programs and develop online things based on the certain type of code.

Mattias's friend asked him to critique his presentation about gorillas. Mattias noticed that there weren't any images of gorillas. What feedback can Mattias give to improve his friend's presentation?
a I like your title, but did you not think to add pictures of gorillas?
b It's ok, but it would be better if I just added pictures to your presentation.
c Really great information, but I think adding a picture of a gorilla would be great.
d You're missing a gorilla picture. Add one.

Answers

Answer:

c

Explanation:

Answer:B

Really great information, but I think adding a picture of a gorilla would be great.

Explanation:

Mattias's friend asked him to critique his presentation about gorillas. Mattias noticed that there weren't any images of gorillas. What feedback can Mattias give to improve his friend's presentation?

Group of answer choices

A)You're missing a gorilla picture. Add one.

B)Really great information, but I think adding a picture of a gorilla would be great.

C)I like your title, but did you not think to add pictures of gorillas?

D)It's ok, but it would be better if I just added pictures to your presentation.

My teacher just asked, "What did you learn about coding and how can it help u through life." CAN SOMEONE PLZ ANSWER BC I DONT KNOW.​

Answers

Answer:

Coding is becoming a big thing in America because more and more jobs are on the computer, because they future is tech.

Explanation:

i dont know something like tht

What information will you find in the 16-bit field in an IP datagram?

Answers

Answer: This 16-bit field defines the entire packet size in bytes, including header and data. The minimum size is 20 bytes (header without data) and the maximum is 65,535 bytes. All hosts are required to be able to reassemble datagrams of size up to 576 bytes, but most modern hosts handle much larger packets.

Explanation: Hopefully this helps you with what ever u are doing.

An information which you will find in the 16-bit field in an IP datagram is: the total length of the datagram it's attached to.

An IP address is an abbreviation of internet protocol address and it can be defined as a unique number assigned to a computer or other network devices such as routers, switches, etc., in order to differentiate each device from one another in an active network system. Thus, an IP address is typically used to uniquely identify each computer or network device connected to the internet or an interconnected network.

In Computer networking, IP address are classified into two (2) main categories and these are;

Local (internal) IP address.Global (external) IP address.

An IP datagram can be defined as the standard format of data that an internet protocol (IP) recognizes.

Generally, an IP datagram comprises two (2) main components and these include:

1. The header: it is used for sending messages on a computer to the protocol in the same layer of a destination (recipient) computer.

2. The data: this is a set of information that is transmitted from one computer to another over an interconnected network.

On a related note, an IP datagram contain three (3) fields which are typically used for the transmission of data;

Header length.IP version.Total length.

The Total length is a field that is used to specify the total length of an IP datagram and it is typically 16-bits in size.

In conclusion, an information which is found in the 16-bit field in an IP datagram is the total length of the datagram it's attached to.

Find more information here: https://brainly.com/question/19204809

Label the following website navigation methods
according to their importance, where 1 is most
important and 3 is least important.

Site map:
Navigation menu:
Site search:

Answers

Answer:

Technology is very important

Answer:

Site map: 3

Navigation menu:1

Site search:2

Explanation:

they will wash the car change into tag question​

Answers

Answer:

They will wash the car, won't they?

Explanation:

A tag question usually comes after an independent clause. The tag question is most times attached with the intent of affirming the statement made in the independent clause. Our independent clause in the answer above is; "They will wash the car". The tag question, "Won't they?" is meant to affirm that statement.

Another example is, "They are going to school, aren't they?" In this example also, the independent clause makes a sentence that is to be confirmed by the tag question.

All of the following are problem-solving steps except:
A. taking action.
B. defining the problem.
c. doing the first solution that comes to mind.
D. creating possible solutions.

Answers

Answer:

C. Doing the first solution that comes to mind.

Explanation:

Lets break this down a bit.

A is a great problem solving step, so we can mark that off.

We can do the same for B.

However, for C, I am hesitant about this one, so I wont mark it off quite yet.

Finally, for D, it is definitely a step, so I can mark that off.

You should never do the first solution that comes to mind, since you haven't done enough brainstorming about other ideas.

Hope this helps!

Return the appropriate part of FizzBuzz This is a small part of a classic software engineering interview question. fizz_buzz_check takes a single integer argument, number. Complete the function such that it returns a value using the following rules: If the number is divisible by 3 (i.e division by 3 has a remainder of 0), return the string Fizz. If it is divisible by five, return the string Buzz. If it is divisible by 3 AND 5, return FizzBuzz. Otherwise, just return the original argument back without any changes.

Answers

Answer:

The function in Python:

def fizz_buzz_check(num):

   if num%3 == 0:

       result = "Fizz"

   if num%5 == 0:

       result = "Buzz"

   if num%3 == 0 and num%5 == 0:

       result = "FizzBuzz"

   if num%3 != 0 and num%5 != 0:

       result = num

   return result

Explanation:

The function to complete is not given. So, I write a new function from scratch.

This defines the function

def fizz_buzz_check(num):

This checks if num is divisible by 3

   if num%3 == 0:

If yes, the returned value is stored as "Fizz"

       result = "Fizz"

This checks if num is divisible by 5

   if num%5 == 0:

If yes, the returned value is stored as "Buzz"

       result = "Buzz"

This checks if num is divisible by 3 and 5

   if num%3 == 0 and num%5 == 0:

If yes, the returned value is stored as "FizzBuzz"

       result = "FizzBuzz"

This checks if num is not divisible by 3 and by 5

   if num%3 != 0 and num%5 != 0:

If yes, the returned value is stored as the initial argument

       result = num

This returns the appropriate value

   return result

In python please!!! Write the definition of a function named countPos that reads integer values from standard input until there are none left and returns the number that are positive. The function must not use a loop of any kind.

Answers

Answer:Here is the method countPos    

 static int countPos(Scanner input){ //method that takes a reference to a Scanner object

  int counter=0;  // to count the positive integers  

  int number; //to store each integer value

  if(input.hasNextInt()){ //checks if next token in this scanner input is an integer value

      number=input.nextInt(); //nextInt() method of a Scanner object reads in a string of digits and converts them into an int type and stores it into number variable

      counter=countPos(input); //calls method by passing the Scanner object and stores it in counter variable

      if(number>0) //if the value is a positive number

          counter++;    } //adds 1 to the counter variable each time a positive input value is enountered

  else    { //if value is not a positive integer

      return counter;    } //returns the value of counter

  return counter; } //returns the total count of the positive numbers

Explanation:

Here is the complete program:

import java.util.Scanner; //to take input from user

public class Main { //class name

//comments with each line of method below are given in Answer section

static int countPos(Scanner input){

  int counter=0;

  int number;

  if(input.hasNextInt()){

      number=input.nextInt();

      counter=countPos(input);

      if(number>0)

          counter++;    }

  else    {

      return counter;    }

  return counter; }

public static void main(String[] args) { //start of main function

      System.out.println("Number of positive integers: " + countPos(new Scanner(System.in)));  } } //prints the number of positive integers by calling countPos method and passing Scanner object to it

The program uses hasNextInt method that returns the next token (next input value) and if condition checks using this method if the input value is an integer. nextInt() keeps scanning the next token of the input as an integer. If the input number is a positive number then the counter variable is incremented to 1 otherwise not. If the use enters anything other than an integer value then the program stops and returns the total number of positive integers input by the user. This technique is used in order to avoid using any loop. The program and its output is attached

Explanation:

What do y’all think are the pros and cons to using technology?

Answers

Answer:

Explanation:

pros. convenient, easy to use, and educational  cons. addictive, mentally draining, and creates a social divide.

The following table represents the addresses and contents (using hexadecimal notation) of some cells in a machine's main memory.Starting with this memory arrangement , follow the sequence of instructions and record the final contents of each of these memory cells: Address Contents 00 AB 01 53 02 D6 03 02 Step 1. Move the contents of the cell whose address is 03 to the cell at address 00. Step 2. Move the value 01 into the cell at address 02. Step 3. Move the value stored at address 01 into the cell at address 03.

Answers

Answer:

I DON'T KNOW THE ANSWER SO SORRY

Explanation:

BUT THANKS FOR THE POINTS

Consider the following argument: Any piece of software that is in the public domain may be copied without permission or fee. But that cannot be done in the case of software under copyright. So, software under copyright must not be in the public domain. The conclusion of the argument is:

Answers

Answer:

"software under copyright must not be in the public domain"

Explanation:

The conclusion of his argument is "software under copyright must not be in the public domain". This combines the two premises that were stated before it in order to form a logical outcome based on the premises. In the case of logic, this would basically be an

IF A and IF B, Then C

type of logic, in which A is "Public Domain Work can be copied", B is "Software under Copyright cannot be copied", and C is the conclusion which would be "software under copyright must not be in the public domain"

Other Questions
The Concrete that surrounds a swimming pool takes less time to heat up than the water in the pool. Why Step 5: Locate fronts and forecast weather patterns.a) Use Map D in the Data section.b) Label the high pressure area with an H.c) Label the low pressure area with an L.d) Recall that fronts occur where there are large changes in temperature, air pressure, andwind speed. Remember that the more fletches, or lines, on a weather symbol indicate higherwind speeds. Using a blue colored pencil, draw and label the cold front on the map.e) Using a red colored pencil, draw and label the warm front on the map.f) Use the map to answer the follow-up questions. As of December 31, 2020, Gill Co. reported accounts receivable of $233,000 and an allowance for uncollectible accounts of $8,900. During 2021, accounts receivable increased by $22,900, (that change includes $7,350 of bad debts that were written off). An analysis of Gill Co.'s December 31, 2021, accounts receivable suggests that the allowance for uncollectible accounts should be 4% of accounts receivable. Bad debt expense for 2021 would be: What policy measures did Ronald Reagan believe were necessary for ending the Cold War? Pls, help thanks bye!! I will mark you brainiest ~ Why it matters that teens are reading less the arctic region is a treeless plain with frozen ground. true or false Match the W question with the end of the sentence that makes the mostsense in the five Ws framework you have learned.Where?is the hero in this story?When?is the main point?Who?will the criminal finally becaught?What?is the author going withthis point?Why?is the author making thispoint? What is the term for the position a person holds in society?A. Social influenceB. Social leaderC. Social classD. Social statusthe answer is D. Social status what evidence does the panorama offer the patronage of the medici family True or False: Republicans identify with the color blue and a donkey. They want a weaker military and do not support traditional family values.A. TrueB. False I REALLY NEED HELP ASAP pls solve this fast pls help me fast can someone please help me Miguel sells insurance. He earns a 6% commission on each sale he makes. Miguel has a goal of earning $600 in commissions. Miguel need to sell $ Worth of insurance to meet his goals A woman bought a bag of rice for $5700 and in 3 weeks later,she could only buy 3/4 of a bag for $5700. Find the percentage increase. Question 5. Which claim is accurate about the areas on this map where Islam spread? B. Compare the words impression and correction. How are they alike?How are they different The answer to my question is For number 13. x^3+7x^2-9x-63For number14. 18x (x-4)BUT SOMEONE SHOW WORK PLS FOR BRAINLYY :))) question on picture: