Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program that reads an integer, a list of words, and a character. The integer signifies how many words are in the list.
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)
Step by Step Solution
★★★★★
3.38 Rating (157 Votes )
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started