Question: Write a program IN JAVA that will accept 2 numbers(user input) as strings of three digits or more(convert int to string via Wrapper Classes), and-

Write a program IN JAVA that will accept 2 numbers(user input) as strings of three digits or more(convert int to string via Wrapper Classes), and-
1) strip out all but the first and last digit of the first and display those digits (ex: 34765 would display 35)
2) Strip out every other digit of the second and display those (ex: 34765 would display 375 OR 46)
3) Add a decimal/ period before the last digit of the two numbers displayed, display those two new numbers. (ex: 35 would become 3.5, 375 would become 37.5, 46 would become 4.6)
4) Add the two resulting numbers from part 3 and display the new value using parseInt/ parseDouble.

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!