Question: Wre a program called Swap java, in the main method, the program fist asks user to inout number and call a method swapDigitPairs to swap
Wre a program called Swap java, in the main method, the program fist asks user to inout number and call a method swapDigitPairs to swap the number as shown in the following figure Then ask the user to ro sting of etersmun bers and cae mmod SwasletterPars to swap the leters as in the following fgure. ease inputamuaber to be swapped 123 e suepped resuit is 213 ease inputstring te be swapped: abed he suapped resuit ie bade lease inout a umber te be swapped: 1235 he swepped result is 13254 lease input a string to be swapped abede he suapped resuit is: acbed The method swapDigtPairs accepts an integer n as a perameter and returns a new integer the 2 and 5, and the 4 and & If the number contains an odd number of digits, leave the leftmost digit in its oniginal place. The method swapDigitPairs should not use String class to help the The method swapLetterPairs will conduct similar swapping operation as swapDigitPairs, but accepts a String as a parameter and return the swapped String You can use String class in this method What to tu 1. Upload all of the java and the class files to the CSc1302 dropbos on httpl Note For all assignments, always use comments to include the programmer information date title of the program and brief deseription of the pregram 2. No copying allowed. If it is found that students eopy from each other, all of these
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
