CARI Infonet

 Forgot password?
 Register

ADVERTISEMENT

View: 3075|Reply: 10

Java Programmin

[Copy link]
Post time 13-7-2012 12:20 PM | Show all posts |Read mode
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
Reply

Use magic Report


ADVERTISEMENT


Post time 13-7-2012 10:31 PM | Show all posts
java x pandai. kalo C++ boleh lah. hehe...
Reply

Use magic Report

Post time 14-7-2012 10:24 PM | Show all posts
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

Use magic Report

 Author| Post time 14-7-2012 10:36 PM | Show all posts
Reply 3# annadellia


    owhh.. yeke.. hehehe~ kalo ingt blh la tlg2 sikit..
Reply

Use magic Report

Post time 14-7-2012 10:58 PM | Show all posts
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

Use magic Report

 Author| Post time 14-7-2012 11:57 PM | Show all posts
Reply 5# annadellia


    tgh usaha sikit2 nie..
Reply

Use magic Report

Follow Us
Post time 15-7-2012 10:29 AM | Show all posts

Java Programmin

tuan tanah boleh cuba dulu.

kalau ade problem di pertengahan baru bole bantu.


(posted by mobile)
Reply

Use magic Report

Post time 23-7-2012 01:10 PM | Show all posts
disebabkan ni foundation, kalau aku bantu maknanya aku dah siapkan benda ni nanti.
maka harapnya TT buat dulu
Reply

Use magic Report


ADVERTISEMENT


 Author| Post time 25-7-2012 11:01 PM | Show all posts
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
  1. import java.util.Scanner;
  2. public class Reverse {

  3.     public void reverseOrder(){
  4.         Scanner input = new Scanner(System.in);
  5.         System.out.println("Enter Integer Value : ");
  6.         int number= input.nextInt();
  7.       
  8.         
  9.     }
  10. }
Copy the Code
untuk kelas reverseTest
  1. public class reverseTest {
  2.    
  3.    
  4.     public static void main(String[] args) {
  5.         
  6.         Reverse R = new Reverse();
  7.         
  8.         R.reverseOrder();
  9.     }
  10.    
  11. }
Copy the Code
ermm... minx tlg yer.. btl2 blur dh nie.. xtau mcm mana nk guna array..
Reply

Use magic Report

Post time 27-7-2012 11:07 AM | Show all posts
Reply

Use magic Report

Post time 31-8-2012 12:43 AM | Show all posts
Salam, boleh tahu nombor itu dalam array atau satu baris?
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

 

ADVERTISEMENT



 

ADVERTISEMENT


 


ADVERTISEMENT
Follow Us

ADVERTISEMENT


Mobile|Archiver|Mobile*default|About Us|CARI Infonet

26-4-2024 06:14 PM GMT+8 , Processed in 0.148465 second(s), 37 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

Quick Reply To Top Return to the list