Write a program that reads an integer, a list of words, and a character. The integer...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that reads an integer, a list of words, and a character. The integer signifies how many words are in the list. The output of the program is every word in the list that contains the character at least once. For coding simplicity, follow each output word by a comma, even the last one. Add a newline to the end of the last output. Assume at least one word in the list will contain the given character. Assume that the list of words will always contain fewer than 20 words Exif the input is: 4 hello zoo sleep drizzle z then the output is 200, drizzle, To achieve the above, first read the list into an array. Keep in mind that the character 'a' is not equal to the character A LAB ACTIVITY 5.19.1: LAB: Contains the character 1 import java.util.Scanner; 3 public class LabProgram ( 5 6 public static void main(String[] args) { /Type your code here. / } Develop mode Submit mode Enter program input (optional) If your code requires input values, provide them here Run program Program output displayed here LabProgram.java Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box Input (from above) → LabProgram.java (Your program) 0/10 Load default template. Output (shown below) Word frequencies 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 fewer 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 Hint: Use two arrays, one array for the strings and one array for the frequencies LAB ACTIVITY 5.18.1: LAB: Word frequencies 1 import java.util.Scanner; 2 3 public class LabProgram ( 4 5 6 8 public static void main(String[] args) { / Type your code here. / Develop mode Submit mode Run program Enter program input (optional) if your code requires input values, provide them here. Program output displayed here LabProgram.java Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box Input (from above) -> LabProgram.java (Your program 0/10 Load default template... Output (shown below) Write a program that reads an integer, a list of words, and a character. The integer signifies how many words are in the list. The output of the program is every word in the list that contains the character at least once. For coding simplicity, follow each output word by a comma, even the last one. Add a newline to the end of the last output. Assume at least one word in the list will contain the given character. Assume that the list of words will always contain fewer than 20 words Exif the input is: 4 hello zoo sleep drizzle z then the output is 200, drizzle, To achieve the above, first read the list into an array. Keep in mind that the character 'a' is not equal to the character A LAB ACTIVITY 5.19.1: LAB: Contains the character 1 import java.util.Scanner; 3 public class LabProgram ( 5 6 public static void main(String[] args) { /Type your code here. / } Develop mode Submit mode Enter program input (optional) If your code requires input values, provide them here Run program Program output displayed here LabProgram.java Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box Input (from above) → LabProgram.java (Your program) 0/10 Load default template. Output (shown below) Word frequencies 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 fewer 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 Hint: Use two arrays, one array for the strings and one array for the frequencies LAB ACTIVITY 5.18.1: LAB: Word frequencies 1 import java.util.Scanner; 2 3 public class LabProgram ( 4 5 6 8 public static void main(String[] args) { / Type your code here. / Develop mode Submit mode Run program Enter program input (optional) if your code requires input values, provide them here. Program output displayed here LabProgram.java Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box Input (from above) -> LabProgram.java (Your program 0/10 Load default template... Output (shown below)
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
Transform the E-R model of project2 into a relational model. TransactionNo Date Hired Education Employee Address NumberOfItems Email 100 MemberD Name Transaction D Member TypeName Member Classify...
-
What is the result of the following? A. 0 B. 0.007 C. The code does not compile due to line 7. D. The code does not compile due to line 8. E. The code does not compile for another reason. 1: import...
-
The intensity of radiation from an electric dipole is proportional to (sin 2 )/r 2 , where is the angle between the electric dipole moment and the position vector r . A radiating electric dipole...
-
Miller and Rock (1985) put forward a signalling model of corporate payout policy. Critically evaluate this model, with specific reference to the theoretical and empirical literature that supports or...
-
What are some indicators that a digital device has been infected?
-
On June 10, Tuzun Company purchased $8,000 of merchandise from Epps Company, FOB shipping point, terms 2/10, n/30. Tuzun pays the freight costs of $400 on June 11. Damaged goods totaling $300 are...
-
Corporate taxation in South Africa is too high and has negative implications for economic growth and our competitiveness with our main trading partners." Do you agree with this statement? Why (not)?...
-
01. Find the accumulated amount. P 1,000 5,250 7,235 10,500 300 02. Find the accumulated amount. P 3,500 3,750 1,875 12,500 250 i (simple interest) 0.5% 5% 2.5% 7% 10% i (simple interest) 0.10% 4%...
-
Jamari spent $50 in automobile repairs, $500 in automobile insurance, $200 in tolls and parking, $700 in gas and oil, and $30 in parking tickets and fines related to the automobile used for business...
-
How do trophic interactions and energy flow within food chains vary across different ecosystems, and what factors influence the structure, complexity, and stability of food webs in terrestrial,...
-
Mr. Tony Stark is the CEO of a company named Stark Industries, and they are considering buying a new versus used production machine. They will sell this machine in two years (when the company's...
-
Identify some notable trends in financial (income statement) performance, particularly Revenues, Net Profit, and Net Profit Margin. What does this tell us about creating/capturing value? Are there...
-
How can interdisciplinary approaches, including genomics, ecology, and mathematical modeling, contribute to our understanding of symbiosis as a dynamic process operating across multiple spatial and...
-
Use a graphing utility to graph the function and find the absolute extrema of the function on the given interval. (Round your answers to three decimal places. If an answer does not exist, enter DNE.)...
-
On October 1, 2021, Adoll Company acquired 2,600 shares of its $1 par value stock for $38 per share and held these shares in treasury. On March 1, 2023, Adoll resold all the treasury shares for $34...
-
State whether each of the following is true or false. If false, explain why. a) The default label is required in the switch selection statement. b) The break statement is required in every case of a...
-
(True/False) You can update a GUI from any thread of execution. If false, explain why.
-
Fill in the blanks in each of the following statements: a) ___________are used to document an app and improve its readability. b) A decision can be made in a C# app with a(n) ___________. c)...
-
From the following trial balance of G. Foot after his first year's trading, you are required to draw up a statement of profit or loss for the year ending 30 June 2016. A statement of financial...
-
At the beginning of the financial year on 1 April 2017, a company had a balance on plant account of 372,000 and on provision for depreciation of plant account of 205,400. The company's policy is to...
-
What circumstances might lead you to write-off a debt as bad and not close the debtor's account?
Study smarter with the SolutionInn App