Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle9i Database Administrator Implementation And Administration

Authors: Carol McCullough-Dieter

1st Edition

0619159006, 978-0619159009

More Books

Students also viewed these Databases questions

Question

How can you make a DFD easier to understand?

Answered: 1 week ago