Question: 1) Write a Java program that has a function finds the maximum, the minimum, and the average values of an array and call the function
1) Write a Java program that has a function finds the maximum, the minimum, and the average values of an array and call the function in the main.
2)
Write a Java program to find the longest word in a given dictionary (two-dimensional array) and the number of this word's occurrences.
- Write a method "findLongestWordAndOccurrences" to do the previous requirements.
- The method's input: two-dimensional array.
- The method's output: print both the word and the number of it's occurrences.
- Write a method "printArray" to print your 2D array.
- The method's input: two-dimensional array.
- The method's output: print every word in that array, one single dimensional array (row) per line.
- In main:
- Fill the dictionary using words off the top of your head.
- Use the printing method to print the dictionary.
- Call the method you created in the above section in main.
3)
Write a program in Java that take a statement or a paragraph from the user and finds the unique words in that input and each of these word's occurrence.
Input to try: Java is my favorite programming language . I like java because it is interesting language and it is easy . It is easy to learn . It is quite interesting language . This is why Java is my favorite programming language .
Hints:
If you have a string s, the method split() splits a String into multiple Strings given the delimiter that separates them. The returned object is an array which contains the split Strings.
String s = "I like Java";
String [] s_array = s.split(" "); //Splitting the sentence based on the space delimiter. Returns String array.
Resulting array is: {"I", "like", "Java"}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
