in Java eclipse ide  Read from console a 2-digit integer number, save it in variable vz. Check this number: if the digit at 10’s place is greater than the digit at 1’s place, swap these 2 digits to construct a new number, then save this new number to vz. For example, if the original number in vz is 65, swap 2 digits and vz will change to 56; if the original number is 34, vz will not change. (Clue: extract digits at 10’s place and 1’s place, compare these 2 digits to determine if these 2 digits need to be swapped or not)

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter6: Looping
Section: Chapter Questions
Problem 5PE
icon
Related questions
Question

in Java eclipse ide 

  1. Read from console a 2-digit integer number, save it in variable vz. Check this number: if the digit at 10’s place is greater than the digit at 1’s place, swap these 2 digits to construct a new number, then save this new number to vz. For example, if the original number in vz is 65, swap 2 digits and vz will change to 56; if the original number is 34, vz will not change.

(Clue: extract digits at 10’s place and 1’s place, compare these 2 digits to determine if these 2 digits need to be swapped or not)

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Types of Loop
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT