Go Back   Webmaster Centre News and Discussion Forum > Website Developement > Web Programming

Web Programming Post your questions, tips and opinions on web scripting, programming languages. Subject areas include Java, Java Script, PHP, ASP, .Net, XML, Perl, HTML, Flash,etc

Reply
 
LinkBack Thread Tools Display Modes
Old 04-29-2008, 05:40 PM   #1 (permalink)
Junior Member
 
Default Java question based on method calls...?

Ok, so what I am trying to do for this prodject is this; I have a method that calculates the difference in of array elements in such that ar[1] - ar[0] and then ar[2] - ar[1] and so on...

Now I have a method that does that fine and works. However I am creating another method that finds the smallest change from that output. How do I call the method above to solve this problem?


/**
Difference of array elements

@param Array of doubles
*/
public static void diffTotal(double ar[]) {

int i = 0;
while (i < ar.length) {

if (i == ar.length - 1) {
break;
}else {

double subtraction = ar[i+1] - ar[i];

System.out.println(subtraction);
}
++i;
}
}

/**
Smallest change in array measurements

@param Array of doubles
*/
public static void smallChange(double ar[]) {
zach s is offline   Reply With Quote
Reply

Bookmarks



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
What's the best RSS feed program (non-web-based)? comfort eagle Web Programming 0 05-03-2008 03:07 AM
does anybody know if theres a 3d browser based mmorpg? gabby Games 0 05-03-2008 03:02 AM
web based msn? Joe M MSN 2 05-01-2008 02:24 AM
The PayPal 6 dollar money making method? Yani Merchant Accounts, Gateways, and Credit Card Processing 0 04-30-2008 08:10 AM
Yahoo to outsource Messenger phone calls to Jajah (AP via Yahoo! Finance) slm.1949 Yahoo 2 04-30-2008 01:18 AM



All times are GMT +1. The time now is 07:42 PM.
Powered by vBulletin® Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Style Provided By: Wrestling Clique - Wrestling Forums

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44