Question: Note: Use Scanner Method so I can test different Sample Inputs. Also provide the code in proper format and comments that I can copy and

Note: Use Scanner Method so I can test different Sample Inputs. Also provide the code in proper format and comments that I can copy and understand properly. Please show output as well
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
