Results 1 to 7 of 7
Thread: Help Please !!!
- 04-17-2012, 08:07 PM #1
Member
- Join Date
- Apr 2012
- Posts
- 8
- Rep Power
- 0
- 04-17-2012, 08:08 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,392
- Blog Entries
- 7
- Rep Power
- 17
Re: Help Please !!!
We are not going to do your homework for you; you go first.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 04-17-2012, 08:10 PM #3
Member
- Join Date
- Apr 2012
- Posts
- 8
- Rep Power
- 0
Re: Help Please !!!
my start
Java Code:return 0; import java.util.*; class nt { public static void main(String args[]) { System.out.println("Enter the elements "); Object sc; char[][] a; for(int i=0;i<10;i++) int a[i]=((Object) sc).nextInt(); System.out.println("you entered the array is"); for(int i=0;i<10;i++) System.out.println(a[i]); System.out.println(" the reverse order array is"); for(int i = 9;i>=0;i--) System.out.println(a[i]); } }Last edited by JosAH; 04-17-2012 at 08:17 PM. Reason: added [code] ... [/code] tags
- 04-17-2012, 08:20 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,392
- Blog Entries
- 7
- Rep Power
- 17
Re: Help Please !!!
Why are you printing your array backwards? It isn't part of your assignment. I take it that 'return 0;' at the start of your program is a copy/paste error but what does your compiler say about it?
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 04-17-2012, 08:23 PM #5
Senior Member
- Join Date
- Apr 2012
- Posts
- 199
- Rep Power
- 0
Re: Help Please !!!
Did you try to compile it? the return 0; at the top of the file will definitely give errors during compilation. Please debug it with a good IDE (i.e. Netbeans) and then state exactly what problems you are having.
- 04-17-2012, 08:23 PM #6
Member
- Join Date
- Apr 2012
- Posts
- 8
- Rep Power
- 0
Re: Help Please !!!
I thought that it would be better to do it that way i dont understand how to sart the methods
- 04-17-2012, 08:38 PM #7
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,392
- Blog Entries
- 7
- Rep Power
- 17
Re: Help Please !!!
This isn't going anywhere; I setup your class structure:
You fill in the dots.Java Code:public class YourClass { private static int[] readArray() { ... } private static void sortAscending(int[] array) { ... } private static void mean(int[] array) { ... } private static void median(int[] array) { ... } private static void minimum(int[] array) { ... } private static void maximum(int[] array) { ... } public static void main(String[] args) { int[] array= readArray(); sortAscendig(array); mean(array); median(array); minimum(array); maximum(array); } }
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks