Java Programmin
korang.. blh x korang share sikit solving korang tuk soalan java nie... :DWrite 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.. :D Replyannadellia
owhh.. yeke.. hehehe~ kalo ingt blh la tlg2 sikit..
DjKiller Post at 14-7-2012 22:36 http://mforum.cari.com.my/images/common/back.gif
cuba dapatkan bantuan pak cik google.. hehe.. ;P 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 :D kmkd posted on 23-7-2012 01:10 PM static/image/common/back.gif
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.. :D
untuk kelas reverseimport 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();
}
}untuk kelas reverseTestpublic class reverseTest {
public static void main(String[] args) {
Reverse R = new Reverse();
R.reverseOrder();
}
}ermm... minx tlg yer.. btl2 blur dh nie.. xtau mcm mana nk guna array..
paling basic aku nampak benda ni mahu kau tahu tentang array dan looping
http://answers.yahoo.com/question/index?qid=20070904201231AAIwpJv
http://www.brilliantsheep.com/3-ways-to-reverse-a-string-in-java/ Salam, boleh tahu nombor itu dalam array atau satu baris?
Pages:
[1]