12:26 4 Wk 2 - Apply: Summative A... = zyBooks ? e You are using an...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
12:26 4 Wk 2 - Apply: Summative A... = zyBooks ? e You are using an unsupported browser. Please see our systems requirements page ✓ for a list of supported browsers. LAB ACTIVITY 2.17.1: LAB: Word frequencies - methods 1 import java.util.Scanner; 2 3 //This is LabProgram.java class 4 5 public class LabProgram { 6 7 //This is getFrequencyOfWord() method, 8 public static int getFrequency Of Word (St int count = 0; 9 10 11 12 for(int i=1; i<=listSize; i++) { if (words List [i].equals(currWord)) coun }//for 13 return count; 14 }//getFrequencyOfWord() end 15 16 17 public static void main(String[] args) Develop mode Submit mode Run your prog input values ir second box. Enter program input (optional) If your code requires input values, provide them here. Run program Program output displayed here Input (from abo 12:26 4 Wk 2 - Apply: Summative A... = zyBooks ? e You are using an unsupported browser. Please see our systems requirements page ✓ for a list of supported browsers. Write a program that reads a list of words. Then, the program outputs those words and their frequencies. The input begins with an integer indicating the number of words that follow. Assume that the list will always contain less than 20 words. Ex: If the input is: 5 hey hi Mark hi mark the output is: hey 1 hi 2 Mark 1 hi 2 mark 1 Hint: Use two arrays, one for the strings, another for the frequencies. Your program must define and call a method: public static int getFrequencyOfWord (String[] words List, int listSize, String currWord) Note: This is a lab from a previous chapter that now requires the use of a method. 396330.1977958.qx3zqy7 LAB ACTIVITY 2.17.1: LAB: Word frequencies - methods. 12:26 4 Wk 2 - Apply: Summative A... = zyBooks ? e You are using an unsupported browser. Please see our systems requirements page ✓ for a list of supported browsers. LAB ACTIVITY 2.17.1: LAB: Word frequencies - methods 1 import java.util.Scanner; 2 3 //This is LabProgram.java class 4 5 public class LabProgram { 6 7 //This is getFrequencyOfWord() method, 8 public static int getFrequency Of Word (St int count = 0; 9 10 11 12 for(int i=1; i<=listSize; i++) { if (words List [i].equals(currWord)) coun }//for 13 return count; 14 }//getFrequencyOfWord() end 15 16 17 public static void main(String[] args) Develop mode Submit mode Run your prog input values ir second box. Enter program input (optional) If your code requires input values, provide them here. Run program Program output displayed here Input (from abo 12:26 4 Wk 2 - Apply: Summative A... = zyBooks ? e You are using an unsupported browser. Please see our systems requirements page ✓ for a list of supported browsers. Write a program that reads a list of words. Then, the program outputs those words and their frequencies. The input begins with an integer indicating the number of words that follow. Assume that the list will always contain less than 20 words. Ex: If the input is: 5 hey hi Mark hi mark the output is: hey 1 hi 2 Mark 1 hi 2 mark 1 Hint: Use two arrays, one for the strings, another for the frequencies. Your program must define and call a method: public static int getFrequencyOfWord (String[] words List, int listSize, String currWord) Note: This is a lab from a previous chapter that now requires the use of a method. 396330.1977958.qx3zqy7 LAB ACTIVITY 2.17.1: LAB: Word frequencies - methods.
Expert Answer:
Answer rating: 100% (QA)
It looks like youve provided a code snippet for a Java program that calculates the frequency of a wo... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
"internet radios" for streaming audio, and personal video recorders and players. Describe design and evaluation processes that could be used by a start-up company to improve the usability of such...
-
Let be an arbitrary operation in Problems 5259. Describe the operation for each problem. 503 = 2; 702= 5; 901 = 8; 8 0 2 = 6;
-
A quantitative data set of size 200 has mean 20 and standard deviation 4. At least how many observations lie between 8 and 32? Apply Chebyshev's rule to solve.
-
A local hardware store has a Savings Wheel at the checkout. Customers get to spin the wheel and, when the wheel stops, a pointer indicates how much they will save. The wheel can stop in any one of 50...
-
In September 2013, Ugo Mattera entered into a written construction contract with Baja Properties, LLC. Stephen Chad Golden, the sole owner of Baja Properties, signed the contract and addendums on...
-
Assume that you are the president of Highlight Construction Company. At the end of the first year (December 31, 2014) of operations, the following financial data for the company are available:...
-
what are the benefits of the relational model relationships and ERD ( entity-relationship model)?
-
The file HotelAway contains the average room price (in US$) paid by various nationalities while traveling abroad (away from their home country) in 2016: 124 101 115 126 114 112 138 85 138 96 130 116...
-
1. Consider the following function. def q1(L): n = len(L) count = 0 for i in L: if i max (L) or i < 0: == count return count count + 1 a. What is the Big-O running time bound for ql in terms of n,...
-
R.E. Lee entered into a 10-year lease in 2015 with Mr. Grant. In addition to the $18,000 a year rent he paid in 2019, he prepaid two months of 2020 rent totaling $3,000. Also, in 2019, Mr. Lee...
-
Has Jodi provided more than 50 percent of the support in the following situations? a. Jodi contributed $4,200 to her mothers support during the year. Her mother received $5,300 in Medicare payments...
-
Charles has interest income of $1,150 and no other income. He is claimed as a dependent by his parents. Is he required to file an income tax return?
-
Fran Finery's boutique has assets of $100,000 and liabilities of $140,000. Fran's major creditor cancels $50,000 in liabilities. Discuss the tax ramifications of this forgiveness of debt. Assume the...
-
Richard and Jennifer were married in 2010. They have a five-year-old child and a son born November 15, 2019. Richard's 67-year-old father lived in a nursing home until his death on May 23, 2019....
-
1. To achieve revenue targets, S Corporation starts selling to customers that are not creditworthy. Which Controls or substantive audit procedure (the most important), if properly performed, could...
-
Graph the following conic sections, labeling vertices, foci, directrices, and asymptotes (if they exist). Give the eccentricity of the curve. Use a graphing utility to check your work. 10 5 + 2 cos 0
-
John Fuji (age 37) moved from California to Washington in December 2011. He lives at 468 Cameo Street, Yakima, WA 98901. John's Social Security number is 571-78-5974 and he is single. His earnings...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-6. On December 12, Irene purchased the building where her store is located. She paid...
-
Clarita is a single taxpayer with two dependent children, ages 10 and 12. Clarita pays $3,000 in qualified child care expenses during the year. If her adjusted gross income (all from wages) for the...
-
Consider an unstable plant \[G(s)=\frac{s+2}{s^{3}+4 s^{2}-5 s}\] with feedback control, as shown in Figure 10.15. a. Using Routh's stability criterion, determine the range of the control gain \(K\)...
-
Consider the closed-loop control system shown in Figure 10.24. a. Using MATLAB, plot the unit-step responses of the system for the following values of \(K: 5,50\), and 500 . b. Compute the...
-
Consider a mass-damper-spring system \(G(s)=Y(s) / U(s)=1 /\left(m s^{2}+b s+k ight)\), where \(m=1 \mathrm{~kg}, b=8 \mathrm{~N} \cdot \mathrm{s} / \mathrm{m}\), and \(k=40 \mathrm{~N} /...
Study smarter with the SolutionInn App