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
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