DjKiller Publish time 13-7-2012 12:20 PM

Java Programmin

korang.. blh x korang share sikit solving korang tuk soalan java nie... :D

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

otai_g Publish time 13-7-2012 10:31 PM

java x pandai. kalo C++ boleh lah. hehe...

annadellia Publish time 14-7-2012 10:24 PM

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.. :$

DjKiller Publish time 14-7-2012 10:36 PM

Reply 3# annadellia


    owhh.. yeke.. hehehe~ kalo ingt blh la tlg2 sikit.. :D

annadellia Publish time 14-7-2012 10:58 PM

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

DjKiller Publish time 14-7-2012 11:57 PM

Reply 5# annadellia


    tgh usaha sikit2 nie.. :)

orang_letrik Publish time 15-7-2012 10:29 AM

Java Programmin

tuan tanah boleh cuba dulu.

kalau ade problem di pertengahan baru bole bantu.


(posted by mobile)

kmkd Publish time 23-7-2012 01:10 PM

disebabkan ni foundation, kalau aku bantu maknanya aku dah siapkan benda ni nanti.
maka harapnya TT buat dulu :D

DjKiller Publish time 25-7-2012 11:01 PM

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..

kmkd Publish time 27-7-2012 11:07 AM

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/

chuki2 Publish time 31-8-2012 12:43 AM

Salam, boleh tahu nombor itu dalam array atau satu baris?
Pages: [1]
View full version: Java Programmin


ADVERTISEMENT