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
Inessa [10]
3 years ago
13

Write a program that reads a list of words. Then, the program outputs those words and their frequencies.

Computers and Technology
1 answer:
LiRa [457]3 years ago
4 0

Answer:

The program in Python is as follows:

mylist = []

nword= "y"

while(nword== "y"):

    word = input(": ")

    mylist.append(word)

    nword = input("New word: y/n: ")

for item in mylist:

    freq = mylist.count(item)  

    print(item, freq)

Explanation:

This creates an empty list

mylist = []

This is used to let the user input more word or stop input

nword = "y"

The following iteration lets the program read words from the user

while(nword == "y"):

This gets the user input

    word = input(": ")

This appends the inputted word into the list

    mylist.append(word)

This prompts if the user wants to input more word or not

    nword = input("New word: y/n: ")

This iterates through the list

for item in mylist:

This gets the frequency of each word in the list

    freq = mylist.count(item)  

This prints the word and the frequency

    print(item, freq)

You might be interested in
Can anyone one help in outlook....plzzzz:)
Inessa [10]
I know a few of them like:

9 is F
(I think) 8 is J
4 is E
(I think) 5 is B

I will attempt to figure the others out but for now here is all I have

EDIT: I think 7 is C
8 0
4 years ago
Write a function that accepts an int array and the array’s size as arguments. 1. The function should create a new array that is
Contact [7]

Answer:

The question seems to be incomplete. Analyzing the full question the answer has been explained below. Please let me know if your answer requirement was other than this.

Explanation:

#include<iostream>

#include<fstream>

using namespace std;

int *extend(int arr[], int N)

{

  // create a new array that is twice

  //the size of the argument array.

  int *new_arr = new int[2 * N];

  int i;

  // copy the contents of the argument

  //array to the new array

  for (i = 0; i < N; i++)

      new_arr[i] = arr[i];

  // initialize the unused elements

  //of the second array with 0

  for (i = N; i < 2 * N; i++)

      new_arr[i] = 0;

  // return a pointer to the new array

  return new_arr;

}

//main function

int main()

{

  // Declare the array

  int N;

  //Prompt and reads an integer N

  cout << "Enter N : ";

  cin >> N;

  // If the integer read in from

  //standard input exceeds 50 or is less than 0

  if (N < 0 || N > 50)

      // The program terminates silently

      exit(0);

  // open file in read mode

  ifstream in("data.txt");

  // create an array of size N

  int *arr = new int[N];

  int i;

  // reads N integers from a file

  //named data into an array

  for (i = 0; i < N; i++)

  {

      // read integer from file

      in >> arr[i];

  }

  //then passes the array to your

  //array expander function

  int *new_arr = extend(arr, N);

  // print the extended array

  for (i = 0; i < 2 * N; i++)

      cout << new_arr[i] << endl;

  in.close();

  return 0;

}

4 0
3 years ago
How we Design a power point presentation with your own voice recording in slide show with at least 10 slides. You can choose any
sukhopar [10]

Answer:

qszdsdddddsq

Explanation:sqdqsdsqdsqd

6 0
3 years ago
All of the following are career pathways in the architecture and construction career cluster except
max2010maxim [7]

Below, I believe are the multiple choices attached to this question

A. Power, Structural, and Technical Systems.

B. Construction.

C. Design/ Pre-Construction.

D. Maintenance/ Operations

The answer is A. Power, Structural, and Technical Systems.

The career pathways in the Architecture and Construction deal with all aspects of designing, planning, maintaining all kinds of structures we live or work in. It is organized into 3 career pathways; Construction, Design/ Pre-Construction, and Maintenance/ Operations. This field also covers the servicing of equipment such as plumbing, electrical wiring, escalators, and elevators.

3 0
3 years ago
Read 2 more answers
Mary is searching for the New Years video that she saved on her laptop which file extension should Mary look for
Zepler [3.9K]

documents file on her laptop

8 0
3 years ago
Read 2 more answers
Other questions:
  • . True or False? a database breach always involves PII.<br><br> A.true<br><br> B.false
    5·1 answer
  • Write a statement that declares a prototype for a function add, which has two int parameters and returns an int .
    13·1 answer
  • You use worksheets to perform calculations. How do you perform these calculations? ______ are used for performing calculations i
    12·2 answers
  • A user could find the icon for an attached usb flash drive under what heading in the my computer/computer window?
    7·1 answer
  • Refer to the color wheel to identify the color scheme.
    13·1 answer
  • Next, Sue decides to embed a chart from Microsoft Word. She copies and pastes data from a table that she has already created in
    8·1 answer
  • Consider two different implementations of the same instruction set architecture (ISA). The instructions can be divided into four
    14·1 answer
  • What would be the desired output of the home-security system
    8·1 answer
  • The template code provided is intended to take two inputs, x and y, from the user and print "pass" if one or more of the followi
    5·1 answer
  • A python program for the following output using for loop.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!