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
shepuryov [24]
3 years ago
8

Implement the function calcWordFrequencies() that uses a single prompt to read a list of words (separated by spaces). Then, the

function outputs those words and their frequencies to the console.
Ex: If the prompt input is:

hey hi Mark hi mark
the console output is:

hey 1
hi 2
Mark 1
hi 2
mark 1
Computers and Technology
1 answer:
Novosadov [1.4K]3 years ago
5 0

Answer:

JavaScript code is given below

Explanation:

function calcWordFrequencies() {

   var words = prompt("Enter the sentence below").split(" ");

   var unique_words = [], freqencies = [], count = 0;

   for (var i = 0; i < words.length; i++) {

       var found = false;

       for (var j = 0; j < count; j++) {

           if (words[i] === unique_words[j]) {

               freqencies[j] = freqencies[j] + 1;

               found = true;

           }

       }

       if (!found) {

           unique_words[count] = words[i];

           freqencies[count] = 1;

           count++;

       }

   }

   for (var i = 0; i < words.length; i++) {

       var result = 0;

       for (var j = 0; j < count; j++) {

           if (words[i] === unique_words[j]) {

               result = freqencies[j];

               break;

           }

       }

       console.log(words[i] + " " + result);

   }

}

You might be interested in
In what way do networks help to protect data
Aleksandr-060686 [28]

One way that computer networks help to protect data is by backing up the data.

Computer networks are normally formatted to automatically back up all of the data that is stored on them. This protects the data in case of any type of computer system failure.

5 0
3 years ago
A __________ note is a private note that you leave for yourself or for other people who might use the presentation file
BaLLatris [955]

Answer:

The answer is that it is a speaker note.

Explanation:

It leaves a note for people that use presentation files. I use it all the time on my google slides.

7 0
3 years ago
Explain block diagram of. computer architure​
ozzi

Answer:

A block diagram is a diagram of a system in which the principal parts or functions are represented by blocks connected by lines that show the relationships of the blocks. They are heavily used in engineering in hardware design, electronic design, software design, and process flow diagrams.

Explanation:

In your question you asked architure but maybe it is architecture (•;

5 0
2 years ago
What are the characteristics of:<br> Master file<br> Transaction file<br> Reference file
IRISSAK [1]
<h3>Master File :-</h3>
  • Master files contain descriptive data, such as name and address, as well as summary information, such as amount due and year-to-date sales.

<h3>Transaction File :-</h3>
  • Fast performance with a rapid response is critical. Organisations rely heavily on their TPS with failure possibly stopping business.

<h3>Reference File :-</h3>
  • Information in one drawing can be overlaid on a different drawing, eliminating the need to redraw information.
  • Proper use of reference files will result in significant time savings and greater coordination of drawings.

Explanation:

<h3>Hope it helps you!</h3>
7 0
2 years ago
A red bullet in a microflow indicates: a. that the microflow has been completed b. that the microflow contains errors c. that on
Viefleur [7K]

Answer:

d. an end point of the microflow mendix

Explanation:

In Computer programming, Microflows can be defined as a visual representation of textual program codes based on the Business Process Model and Notation (BPMN), it enables users to express the logic of application.

It is capable of performing various actions such as creating and updating objects, showing pages and making choices.

Microflows cannot be used in offline apps as it basically runs in the runtime server.

A red bullet in a microflow indicates an end point of the microflow mendix.

8 0
3 years ago
Other questions:
  • Which of the following is the core of an operating system that maintains the computer’s clock, starts applications, and assigns
    7·1 answer
  • Is it more beneficial to have many folders or is it better to " nest subfolders? Explain your response
    5·1 answer
  • Mateo could not find the undo command or shortcut. He should _____.
    15·2 answers
  • What PowerShell command can be used to clean up old update files on a WSUS server, including unused update files, old revisions,
    10·1 answer
  • Write a program that prompts the user to enter a grade, which is aninteger in the range of 0 - 100. Using if statements, have th
    11·1 answer
  • Write a program whose input is two integers, and whose output is the first integer and subsequent increments of 5 as long as the
    10·1 answer
  • It is a blueprint of a project​
    9·2 answers
  • 40 points
    5·2 answers
  • Which statement best describes what happens when a computer starts?
    9·1 answer
  • Write a loop that continually asks the user what pets the user has until the user enters stop, in which case the loop ends. It s
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!