The goal of this program is to input one number consisting of five digits (in one word) from the user, and print the digits in reverse order. For example, if the user types in the number 42339, the program should print 93324 To do that :

EBK JAVA PROGRAMMING
8th Edition
ISBN:9781305480537
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 9PE
icon
Related questions
Question
1%Vo l 3G
50
The goal of this program is to input one number consisting of five digits (in one
word) from the user, and print the digits in reverse order. For example, if the user
types in the number 42339, the program should print
93324
To do that :
1* Create the java project (LabTest_M_yourName_ID) with class main named
LabTest. Add to this project, a new class without main called the class Digit.
2* In the Digit class, add two private data members the digit of String type and an
array T of characters,
3* In the Digit class, add readDigit(0 method (not static) that read a digit as a word by
the keyboard. Note that this digit should not contain spaces.
4* In the Digit class, add a static method named reverse() that traverses the digit
word and puts each digit in the reverse order in the T array.
5* Add the displayDigit() method (not static) that shows the word and the array T.
In the method main of the class LabTest:
6.1. Create a Digit object called DD.
6.2. Use DD to call the readDigit() method to read the word
digit.
6.3. Use DD when you call the reverse() method to fill the array T with the reverse
digits.
6.4. Use DD to call the displayDigit() method to show the word and the array of DD
object.
التفاف النص
أدوات
لوحة المفاتيح
Transcribed Image Text:1%Vo l 3G 50 The goal of this program is to input one number consisting of five digits (in one word) from the user, and print the digits in reverse order. For example, if the user types in the number 42339, the program should print 93324 To do that : 1* Create the java project (LabTest_M_yourName_ID) with class main named LabTest. Add to this project, a new class without main called the class Digit. 2* In the Digit class, add two private data members the digit of String type and an array T of characters, 3* In the Digit class, add readDigit(0 method (not static) that read a digit as a word by the keyboard. Note that this digit should not contain spaces. 4* In the Digit class, add a static method named reverse() that traverses the digit word and puts each digit in the reverse order in the T array. 5* Add the displayDigit() method (not static) that shows the word and the array T. In the method main of the class LabTest: 6.1. Create a Digit object called DD. 6.2. Use DD to call the readDigit() method to read the word digit. 6.3. Use DD when you call the reverse() method to fill the array T with the reverse digits. 6.4. Use DD to call the displayDigit() method to show the word and the array of DD object. التفاف النص أدوات لوحة المفاتيح
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Constants and Variables
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:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT