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
1. An Excel file is called a workbook?<br> A) True<br> B) False
RoseWind [281]

Answer:

B) False

Explanation:

it's called Worksheet

3 0
3 years ago
Read 2 more answers
Two Windows features are “boot in safe mode” (with limited user abilities) and “boot from disk.” Windows also has a third, easy-
RSB [31]

Answer:

Two Windows features are “boot in safe mode” (with limited user abilities) and “boot from disk.” Windows also has a third, easy-to-access startup utility that allows users to control which applications are started automatically when the OS is reset. How might these features enhance cybersecurity for Windows users?Two Windows features are “boot in safe mode” (with limited user abilities) and “boot from disk.” Windows also has a third, easy-to-access startup utility that allows users to control which applications are started automatically when the OS is reset. How might these features enhance cybersecurity for Windows users?

Explanation:

Two Windows features are “boot in safe mode” (with limited user abilities) and “boot from disk.” Windows also has a third, easy-to-access startup utility that allows users to control which applications are started automatically when the OS is reset. How might these features enhance cybersecurity for Windows users?Two Windows features are “boot in safe mode” (with limited user abilities) and “boot from disk.” Windows also has a third, easy-to-access startup utility that allows users to control which applications are started automatically when the OS is reset. How might these features enhance cybersecurity for Windows users?Two Windows features are “boot in safe mode” (with limited user abilities) and “boot from disk.” Windows also has a third, easy-to-access startup utility that allows users to control which applications are started automatically when the OS is reset. How might these features enhance cybersecurity for Windows users?Two Windows features are “boot in safe mode” (with limited user abilities) and “boot from disk.” Windows also has a third, easy-to-access startup utility that allows users to control which applications are started automatically when the OS is reset. How might these features enhance cybersecurity for Windows users?Two Windows features are “boot in safe mode” (with limited user abilities) and “boot from disk.” Windows also has a third, easy-to-access startup utility that allows users to control which applications are started automatically when the OS is reset. How might these features enhance cybersecurity for Windows users?Two Windows features are “boot in safe mode” (with limited user abilities) and “boot from disk.” Windows also has a third, easy-to-access startup utility that allows users to control which applications are started automatically when the OS is reset. How might these features enhance cybersecurity for Windows users?Two Windows features are “boot in safe mode” (with limited user abilities) and “boot from disk.” Windows also has a third, easy-to-access startup utility that allows users to control which applications are started automatically when the OS is reset. How might these features enhance cybersecurity for Windows users?Two Windows features are “boot in safe mode” (with limited user abilities) and “boot from disk.” Windows also has a third, easy-to-access startup utility that allows users to control which applications are started automatically when the OS is reset. How might these features enhance cybersecurity for Windows users?Two Windows features are “boot in safe mode” (with limited user abilities) and “boot from disk.” Windows also has a third, easy-to-access startup utility that allows users to control which applications are started automatically when the OS is reset. How might these features enhance cybersecurity for Windows users?

8 0
3 years ago
Who can help me with 50 varables on codeskulptor​
MrMuchimi

Answer:variables - placeholders for important values

# used to avoid recomputing values and to

# give values names that help reader understand code

# valid variable names - consists of letters, numbers, underscore (_)

# starts with letter or underscore

# case sensitive (capitalization matters)

# legal names - ninja, Ninja, n_i_n_j_a

# illegal names - 1337, 1337 ninja

# Python convention - multiple words joined by _

# legal names - elite_ninja, leet_ninja, ninja_1337

# illegal name 1337_ninja

# assign to variable name using single equal sign =

# (remember that double equals == is used to test equality)

# examples  

my_name = "Joe Warren"

print my_name

my_age = 51

print my_age

# birthday - add one

#my_age += 1

print my_age

# the story of the magic pill

magic_pill = 30

print my_age - magic_pill

my_grand_dad = 74

print my_grand_dad - 2 * magic_pill

Explanation:placeholders for important values. 2. # used to avoid recomputing values and to. 3. # give values names that help reader understand code. 4. ​. 5. ​.

6 0
4 years ago
Which of the following do nylon and Kevlar fibers have in common?
asambeis [7]

Answer:

Kevlar. Kevlar is similar in structure to nylon-6,6 except that instead of the amide links joining chains of carbon atoms together, they join benzene rings. The two monomers are benzene-1,4-dicarboxylic acid and 1,4-diaminobenzene.

Explanation:

3 0
2 years ago
1. In Access, a template is which of the following? a. A database to manage contacts b. Where a database is stored c. Two tables
sweet [91]
Where a database is stored
7 0
3 years ago
Other questions:
  • HELP NOW PLZZ/ Question: Complete the sentence with the correct response.
    11·1 answer
  • One metric ton is approximately 2,205 pounds.
    6·1 answer
  • When you right-click certain areas of the Word or other Office app windows, a command menu will appear. Group of answer choices
    13·1 answer
  • Why should you need to have skills and an understanding about programming?
    8·1 answer
  • Which image shows organic shapes? <br> A. image 1 <br> B. image 2 <br> C. image 3 <br> D. image 4
    14·2 answers
  • In which phase of the software development process would probing questions be used to verify the problem definition?
    12·1 answer
  • I live in Alabama and I’m ab to leave to go on a 3 week trip to France and I’m wondering how I can get LTE for my IPhone 6s Plus
    15·2 answers
  • How many times will line 7 be executed when the following code is run?
    5·1 answer
  • MODERATOR DELETE MY ACC
    8·2 answers
  • Type the correct answer in the box. Spell all words correctly.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!