Question: **Java Code Please for the 3 tasks** In this assignment, you are asked to write a Java program that has a main and two other

**Java Code Please for the 3 tasks**

In this assignment, you are asked to write a Java program that has a main and two other methods.

1. The main method reads a text input (String) from a user using the Scanner class. The user might enter a sequence of white spaces in the text input. For example, Hello there, How are you .

2. Method one, name it CountWords: takes a String as an argument and returns an integer. The method counts how many words in the argument text (String), and returns it to the caller (the main method in our case). For example, if the user input is Hello there, How are you , the method returns 5.

3. Methods two, name it PrintInReverse: takes a String as an argument and returns nothing (void). The method displays the input argument in reverse. For example, if the user input is Hello there, How are you , it will be displayed as uoy era woH ,ereht olleH

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!