|
korang.. blh x korang share sikit solving korang tuk soalan java nie...
Write a program that prompt user to enter an integer value and display the number with its digits reversed and also the largest and the smallest digit. Program should have the following:
1. You should have two classes ‘Reverse’ and ‘reverseTest’.
2. The class ‘reverseTest’ should accept integer value from the user and pass this value to a method ‘reverseOrder’ of ‘Reverse’ class.
3. The method ‘ReverseOrder’ should display value in reverse order and store each and every digit in an array.
4. The ‘reverseOrder’ method should call two other methods ‘reverseLargest’ and ‘ReverseSmallest’ and pass array to these methods.
5. The method ‘reverseLargest’ should find the largest digit from the array and display the result.
6. The method ‘reverseSmallest’ should find the smallest digit from the array and display the result.
7. Your program output should appears as:
Enter integer value: 7892
The Reverse number is: 2987
The Largest digit is: 9
The Smallest digit is: 2 |
|
|
|
|
|
|
|
java x pandai. kalo C++ boleh lah. hehe... |
|
|
|
|
|
|
|
ko punya soalan lebih kurang task assignment masa aku study dulu... hehehe..
by the way, aku dh x berapa nak mahir java coz skg ngadap CI je.. |
|
|
|
|
|
|
|
Reply 3# annadellia
owhh.. yeke.. hehehe~ kalo ingt blh la tlg2 sikit.. |
|
|
|
|
|
|
|
Reply annadellia
owhh.. yeke.. hehehe~ kalo ingt blh la tlg2 sikit..
DjKiller Post at 14-7-2012 22:36
cuba dapatkan bantuan pak cik google.. hehe.. |
|
|
|
|
|
|
|
Reply 5# annadellia
tgh usaha sikit2 nie.. |
|
|
|
|
|
|
|
Java Programmin
tuan tanah boleh cuba dulu.
kalau ade problem di pertengahan baru bole bantu.
(posted by mobile) |
|
|
|
|
|
|
|
disebabkan ni foundation, kalau aku bantu maknanya aku dah siapkan benda ni nanti.
maka harapnya TT buat dulu |
|
|
|
|
|
|
|
kmkd posted on 23-7-2012 01:10 PM
disebabkan ni foundation, kalau aku bantu maknanya aku dah siapkan benda ni nanti.
maka harapnya TT ...
ermm... xdapat nk terbalikkan nombr tu.. nie separuh tuk strting coding..
untuk kelas reverse- import java.util.Scanner;
- public class Reverse {
- public void reverseOrder(){
- Scanner input = new Scanner(System.in);
- System.out.println("Enter Integer Value : ");
- int number= input.nextInt();
-
-
- }
- }
Copy the Code untuk kelas reverseTest- public class reverseTest {
-
-
- public static void main(String[] args) {
-
- Reverse R = new Reverse();
-
- R.reverseOrder();
- }
-
- }
Copy the Code ermm... minx tlg yer.. btl2 blur dh nie.. xtau mcm mana nk guna array..
|
|
|
|
|
|
|
|
Salam, boleh tahu nombor itu dalam array atau satu baris? |
|
|
|
|
|
|
| |
|