Question: 3. Write a method called reverse that accepts the Scanner object as its parameter. This method asks the user for the entire name and prints

3. Write a method called reverse that accepts the Scanner object as its parameter. This method asks the user for the entire name and prints the name in the reverse order. You must only use nextLine() method. If the user enters Mary Lumbardi then the method should output: Lumbardi Mary

main method: in this method, you need to ask the user how many times he/she wants to run each method and create a for loop for each of the method class. In the main you need to have three for loops for each of the methods except the method reverse. You must create a Scanner object so that you can pass it to different methods. Only one scanner object is needed for the whole program.

Enter your first and last name separated by a space > Mary Lambardi Here is your name in the reverse order: Lambardi Mary

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!