Comment

Shane
Sum by,
May 26, 2009 at 10:47 PM

Can anyone help?
I need to write some code whereby I have say for example the following values (amounts and ccy's):

USD 150
GBP 200
EUR 175
USD 400
JPY 350
GBP 100
EUR 550

I need to sum these amounts by the currencys so I return the following:

Totals
USD 550
GBP 300
EUR 725
JPY 350

Thanks in advance
View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
Java Beginners

1-2+5-10+17-26 sum the series - Java Beginners
1-2+5-10+17-26 sum the series  1-2+5-10+17-26 sum the series  Hey Ankit, Try the following code. public class SumOfSeries3 { /** * @param 'series' holds the series need to be printed */ StringBuffer 

Java Beginners

Sum of integers
Sum of integers  A Java program that reads an integer value from the user and displays i) the sum of all even integers between 1 and the input value, both inclusive. ii) The sum of all odd integers between 1 and the input 

Java Beginners

Calculate sum and Average in java
Calculate sum and Average in java  How to calculate sum and average in java program?   Example:- import java.io.BufferedReader; import...(); int num = Integer.parseInt(data); int sum = 0; float avg 

Java Beginners

Sum database colum in java
Sum database colum in java  please i have two columns-col1 and col2... the database to sum the Items and display output so that it will be like... question what you have asked. select item, sum(quqantity) from `order` group 

Java Beginners

Sum of first n numbers
Sum of first n numbers  i want a simple java program which will show the sum of first n numbers....   import java.util.*; public class...=input.nextInt(); long sum=0; for(int i=1;i<=n;i++){ sum+=i 

Java Beginners

sum of fibonacci series
sum of fibonacci series  Write a Java program to print Fibonacci series upto n and find their sum also. 0+1+1+2+3+5+8+13+21â?¦â?¦â?¦â?¦=sum   Hi, Please see the thread Fibonacci program. Thanks 

JSP Servlet Questions

Sum - JSP-Servlet
the total sum of items from database using Java servlet or Jsp and html form. It should display the affected rows and the total sum of all in a seperate column..., Sum Into Database Salary 

Java Beginners

sum
sum  a program to find the sum of the alternative diagit of it ex- no=123456 sum=1+3+5=9 

General

Java Sum of Digits
Java Sum of Digits In this Java Tutorial section, you will learn how to find the sum of multidigit number. For this purpose, we have allowed the user to enter... for Sum of Digits in Java: import java.util.*; class SumOfDigits { public 

Java Beginners

sum
; sum=sum+s; if(i==n){ System.out.print(s...+"+"); } System.out.print("\nSum of the series : "+sum 

Java Beginners

sum
 

Java Beginners

sum
 

Java Beginners

sum
 

Java Beginners

sum
 

Java Beginners

sum
 

Java Beginners

sum
 

Java Beginners

sum
 

Java Beginners

sum
 

Java Interview Questions

how to find the sum of integers in a string of sentence in java
how to find the sum of integers in a string of sentence in java  how to find the sum of integers in a string of sentence in java for e.g:--> abc d 2 3 21 the output should be 2+3+21=26 

JPA

JPA Sum Function
JPA Sum Function       In this section, you will learn about sum function of aggregate function of JPQL (Java Persistence Query Language). The sum function to calculate the sum 

Java Tips and Examples

A program to find the sum of odd number
A program to find the sum of odd number In this section you will learn how to find the sum of odd number in the series up to the given number in java... the console. Now here is the simple example which will help you to find the sum of odd 

JDBC

Sum of Column in a Database Table
C:\vinod\jdbc\jdbc\jdbc-mysql>java SumColumn Sum of the specific... Sum of Column in a Database Table       This section describes how we can calculate the sum 

General

Calculate the Sum of three Numbers
Calculate the Sum of Three Numbers       This is simple java programming tutorial . In this section you will learn how to calculate the sum of three numbers by using three 

Java Beginners

java code - Java Beginners
. http://www.roseindia.net/java/beginners/SquareMatrix.shtml Thanks...java code  Dear sir i need matris form like 1 2 3 4 5 6 7 8 9 what is the code but one request use one loop only any thing forloop 

General

Sum of a Number using Swing
Sum of a Number using Swing       In this section, you will learn how to sum of a number using swing... used in this application : 1. JFrame is used to  creating  java 

Java Tips and Examples

Sum of two Matrix
Sum of  two Matrix       In this section, we are going to calculate the sum of two matrix... to this. In this program we are going to calculate the sum of two matrix. To make this program 

Core Java Tutorials

Find sum of all the elements of matrix using Java
Find sum of all the elements of matrix using Java A matrix is a rectangular... dimensional array. Now to determine the sum of all these elements, we have initialized a variable sum to 0 and create for loops to iterate throughout the array 

General

Calculate sum of even and odd numbers in Java
Calculate sum of even and odd numbers In this section, you will learn how to read the file that contains even and odd numbers and calculate their sum... numbers from the file and then calculate their sum. Here is the code 

Java Beginners

Java Compilation - Java Beginners
Java Compilation  How would i write a complete java program which... the sum hits or exceeds 30. Then print out the sum. is it like this: import java.util.Scanner; public class Sum { public static void main(String[] args 

Java Beginners

sum of the series
sum of the series  Program to sum the series 1+1/1!+1/2!+1/3!+....n 

Java Server Faces Questions

sum in JTable
sum in JTable  how to calculate sum from JTable's one field like total 

Java Beginners

Sum of seris
Sum of seris  Program to find the sum of the following series using a function declaration. sum=x-(xxx)/3!+(xxxxx)/5!-(xxxxxxx)/7!+.....(xx....x)/n!. Where n and x are entered from the keyboard 

Java Beginners

java - Java Beginners
java  WRITE THE CODE IN JAVA FOR THE FOLLOWING PROGRAMS(USING FOR LOOP): 1. H HE HEL HELL HELLO 2. 54321 4321 321 21 1  public class ForLoop { public static void main(String 

Java Beginners

Java Program - Java Beginners
Java Program  Write a java program to find out the sum of digits...: "); num = input.nextInt(); int sum = 0; while (num != 0) { sum += num % 10; num =num/ 10 

Java Interview Questions

ask user how many numbers to be inputted and determine the sum and highest number using an array in java
ask user how many numbers to be inputted and determine the sum and highest number using an array in java  ask user how many numbers to be inputted and determine the sum and highest number using an array in java 

Java Beginners

Java Program - Java Beginners
Java Program  Write a java program to find out the sum of n-number of digits of a given number by the user 

Java Beginners

Java Code - Java Beginners
Java Code  Code a for loop that adds the integers that are multiples of 5 starting with 50 and ending with 5. Each time the sum is increased, print... Sum5 { public static void main(String args[]) { int sum=0; for(int 

Java Beginners

Java Compilation - Java Beginners
Java Compilation  I want to write a program that takes a positive integer from the keyboard. I want my program to sum all the integers from 1 up... will sum 1+2+3+4+5. I want the program to make the same calculation three times 

Java Beginners

Java Coding - Java Beginners
Java Coding  How do I code the following: Code a while loop that calculates the sum of the integers that are multiples of 5 starting with 5 and ending with 100. Each time the sum is increased, print it on a line at the console 

Java Beginners

java program - Java Beginners
java program  take the value of "A" then calculate and print the sum...(bf.readLine()); double sum = 0.0; double term = 1.0; for (int i = 1; sum != sum + term; i++) { sum = sum + term 

Java Beginners

Java Program - Java Beginners
Java Program  Write a java program to find out the sum of a given... num2=input.nextInt(); int sum=num1+num2; System.out.println("Sum of two numbers: "+sum); } } Thanks 

JSP Tutorials

Display Sum of Table Column Using In JSP
Display Sum of Table Column Using In JSP... an application to Display the sum data of a Table column for a specific Date. We created five file sum_count.jsp, resultForm.jsp, result_count.jsp, sumcount.java 

Java Beginners

java - Java Beginners
java  Question-Write a recursive function in java to find sum of n... SumOfSeries { public static double sum(int n) { if (n == 1) return 1.0; return sum(n-1) + 1.0/n; } public static void main(String 

Java Beginners

Java Program - Java Beginners
Java Program  Write a program to compute sum of digits of a given...(); int sum = 0; while (num != 0) { sum += num...; } System.out.println("Sum of digits: " + sum); } } Thanks 

Java Beginners

Java Compilation - Java Beginners
Java Compilation  I want to write a program that takes a positive integer from the keyboard. I want my program to sum all the integers from 1 up... will sum 1+2+3+4+5. I want the program to make the same calculation three times 

Java Beginners

program - Java Beginners
of No's is divisible by 7 : " + sum); } } For more information on java visit...program  Write a program to find the number of and sum of all... void main(String[] args) { int sum=0; for(int i=101;i<200;i 

Java Beginners

java conrolling statements - Java Beginners
java conrolling statements  write a Java program to accept 10 integers and print the sum of numbers divisible by 5 

Java Beginners

Java Coding - Java Beginners
Java Coding  Code a for loop that adds the integers that are multiples of 5 starting with 50 and ending with 5. Each time the sum is increased, print it on a line at the console. Be sure to declare and initialize any required 

Java Beginners

java - Java Beginners
){ int max=0; int j=0; int sum=0; int arr[]=new int[100]; Random r=new...); System.out.println( arr[i] ); sum+=arr[i]; while(arr[i]>max) { max=arr[i]; j=i; } } int mean=sum/arr.length; System.out.println("Sum: "+sum 

Java Beginners

java - Java Beginners
the sum of geometric series?a+ar+ar^2+ar^3+??+ar^n-1 Q 6- write a program in java... in java to sum series?x+x^2+x^3+x^4+ ??..+x^n Q12 write a program in java...-conversion http://www.roseindia.net/java/beginners I hope this will help you 

Java Beginners

java beginners
java beginners  Write a program that asks the user to enter five test...*; public class Student{ public static int calcAverage(int scores[]){ int sum=0; int average=0; for(int i=0;i<scores.length;i++){ sum+=scores 

Java Beginners

JAVA THREAD - Java Beginners
JAVA THREAD  hii i wrote a pgm to print the numbers from 0 to 9 in 2...); } public void fgh(int i,int p) { int sum; new Thread(public void run() { System.out.println("Sum"+sum); for(;i  hi antony try 

Java Beginners

java - Java Beginners
java  Write a java program to implement arithmetic operations...; int num1; int num2; int sum; int sub,mul,div... sum = num1 + num2; JOptionPane.showMessageDialog( null, "The sum is " + sum 

Java Beginners

method overloading - Java Beginners
overloading for sum ( ) function.  class overloadingDemo { public void...; System.out.println("Sum="+n); } public void sumload(int a,int b,int c) //ex: calling sumload(10,20,30) { int n=a+b+c; System.out.println("Sum:"+n 

Java Beginners

java - Java Beginners
and calculating sum of two numbers"); System.out.println("Sum is : "+c... links: http://www.roseindia.net/java/java-tips/language/10basics/import.shtml http://www.roseindia.net/java/master-java/enum.shtml http://www.roseindia.net 

Java Beginners

Java Not running - Java Beginners
Java Not running  Hi, I tried to create a grade(type array... to represntation of each score into a double in .JSP file double sum, average; sum = 0; for (int i = 0; i < grades.length; i 

Java Beginners

java - Java Beginners
void sum() { System.out.println("sum="+(d1+d2)); } } import...;Hi friend, we test and run the program correctly. The output is : sum 

Java Beginners

perfect number - Java Beginners
) { long sum = 0; for (long i = 1; i < n; i++) if (n % i == 0) sum = sum + i; System.out.println("The sum of the divisors of " + n + " is " + sum); if (sum == n) break 

Java Interview Questions

sum and average of grades
sum and average of grades  how to print a program which is sum and average of Korean (90), English(85), Mathematics(78), Biology(65), Chemistry(83 

Java Beginners

java - Java Beginners
java  Hi guys, Thanks for your help to many... Please I need java codes to solve the following problems. 1. X2-y2 where x=sum of odd numbers from 1... java code to show the frequency of occurance of all the sides. Thank you all 

Java Beginners

Java Program - Java Beginners
Java Program  Hi I'm having trouble with this program, i keep getting... StreamTokenizer(r); st.parseNumbers(); int sum = 0; st.nextToken... == StreamTokenizer.TT_NUMBER) sum += st.nval; else System.out.print 

Java Beginners

java loops - Java Beginners
java loops  Q1 print the following pyramid? -------------* -----------* * ---------* * -------* * -----* * ---* * * * * * * * * * * * Q2-write...? Q4- Write a program to sum the series- 2/9-5/13+8/17......... Q 5 

Java Beginners

Java Coding - Java Beginners
Java Coding  Two overloading methods that returns average using following headers A) public static int average(int[] array) B) public static... OverloadedMethod{ public static int average(int[] array){ int sum=0; int average=0 

Java Beginners

java - Java Beginners
java  write a java class for double vectors and rational vectors extending the abstract vector class and implement double vector and find the sum... RuntimeException("Dimensions don't agree"); } double sum = 0.0; for (int i = 0; i < 

Java Beginners

Series program in Java - Java Beginners
Series program in Java  Wap to print the series and find the sum:- 1...(begin, end); obj.MoidfySeries(); System.out.println("Sum of the series...--) { temp = temp*i; } return temp; } public int Sum(int start 

Java Beginners

java Program - Java Beginners
java Program  1. Write a java program to accept 10 numbers in an array and compute the sum of the square of these number. 2. Wrtie a java program...[5]; int sum=0; for(int i=0;i { public int compare(String o1, String o2 

Java Beginners

java program - Java Beginners
java program  m postin a program...hv 2 create a class,wid 6 data membr havin name,no,grade,n marks n 3 sub..........dere vil b 3 membr function.d... sum dificulties 

Java Beginners

Perfect Numbers - Java Beginners
it is equal to the sum of all its exact divisors (other than itself). 6 = 1 + 2 + 3 Write a java program that finds and prints the three smallest perfect... class PerfectNumber{ public static void main(String[]args){ int sum=0, x=0 

Java Beginners

calculate sum of individual digit
calculate sum of individual digit   How calculate product of first and last digit of indiviual numbers Like a=43278 4*8=32 

Java Beginners

java - Java Beginners
from the abstract vector class & implement the double vector.also find sum... sum = 0.0; for (int i = 0; i < in; i++) { sum = sum + (a.data[i] * b.data[i]); } return sum; } public double magnitude(){ Vector a = this; return 

Java Beginners

Java array - Java Beginners
Java array  Q 1- write a program that counts the frequency... a program tofind sum of all non dioganal elements of a two dimensional NxN array...-- programming java hello would be displayed as hello java programming 

Hibernate Questions

Using sum() in hibernate criteria.
Using sum() in hibernate criteria.  How to calculate sum() in hibernate criteria by using projection?   You can calculate sum of any...(employee); } } } Output: Hibernate: select sum 

Java Beginners

Sum of positive and negative numbers
Sum of positive and negative numbers  Hi if someone could help... the sum of all the positive integers and the sum of all the negative integers.  ...]; } } System.out.println("Sum of positive numbers: "+sum2); System.out.println 

Java Beginners

coding - Java Beginners
static void main(String[] args) { int sum=0; String str="YOKO HAS SMILED... + "."); sum+=j; } System.out.println(sum+10); } } Thanks 

Java Beginners

computers - Java Beginners
computers  write a program using a method product (int,int) to find the sum of the given series: S=(1*2)+(2*3)+(3*4)......+(9*10) plzzz help me 

Java Beginners

sum database column
sum database column  please i have two columns-col1 and col2, col1... 3 Soap 4 how will i query the database to sum the Items... for you. select item, sum(quqantity) from `order` group by item 

Java Beginners

calculate sum of individual digit
calculate sum of individual digit  Hi How to calculate product of first snd last digit of indiviual digit Like Num=23456 S=2*6 

Hibernate-Tutorials

Hibernate criteria sum.
Hibernate criteria  sum. Here, we will introduce you to about the sum() function . It returns the sum of total value of column. Syntax : Criteria... message as shown below: Hibernate: select sum(this_.fee 

Java Beginners

C++ programming language - Java Beginners
, sum = 1,j ; scanf("%d", &j); while (i <= j) { sum = sum + (i /3+i/5); printf("%d\n", sum); i = i +i/3+i/5; } } I couldnt get 

Java Beginners

c programming language - Java Beginners
c programming language  int main() { int i = 1, c = 0, sum...) { sum = sum + (i /3+i/5); printf("%d\n", sum); i = i +i/3+i/5; } } I cant get my output 

Java Beginners

OOP - Java Beginners
); } For more information on Java visit to : http://www.roseindia.net/java/ http://www.roseindia.net/java/beginners/Construct.shtml Thanks...; public void print() { System.out.println(x + " " +y); } public int sum 

Java Beginners

a java program... - Java Beginners
a java program...  write a program to check that a number is Armstrong or not. An armstrong is one which is same as the sum of the cube of the digits of the number. write a program to print the following pattern 55555 54444 

Java Beginners

java Code Problem - Java Beginners
java Code Problem  Hi Sir. i am creating one java program in which i want to remove unsed variables from java program and store it into another... a1,a2,a3,a3,a5; int sum(int a1,int a5) { this.a1=a1; this.a5=a5; return a1+a5 

Java Beginners

Commandline arguments - Java Beginners
and display their sum and average. Please respond as soon as possible.  ... = new Scanner (System.in); int [] numbers = new int [10]; int sum=0 

Java Beginners

error - Java Beginners
error  import java.awt.*; import java.awt.event.*; class Sum...; public Sum() { f... = newButton("Sum 

Java Beginners

two dimensional - Java Beginners
the sum of all the numbers stored in it.  Hi Friend, Try the following...; int sum=0; int[][] matrix; Scanner input = new...++) { for (int j = 0; j < cols; j++) { sum+=matrix[i][j 

Java Beginners

java - Java Beginners
java   what is the difference between overloading and overriding pl... A { int i; A(int a, int b) { i = a+b; } void add() { System.out.println("Sum...(); System.out.println("Sum of a, b and c is: " + j); } } class MethodOverriding { public static 

Java Beginners

java program - Java Beginners
java program  "Helo man&sir can you share or gave me a java code hope its ok?" a. Write a definition of the method ONE so that it returns the sum... A JAVA CODE.THANKS  Hi friend, Having some doubts on Your 

Java Beginners

java program - Java Beginners
java program  this is the code. and i want also to display...().iterator(); int sum=0; int max=0; while( iterator. hasNext() ){ int s... iterator = map.keySet().iterator(); int sum=0; int max=0; while( iterator 

Java Beginners

code problem - Java Beginners
(new Integer(40)); al.add(new Integer(30)); int sum=0; Iterator itr = al.iterator(); while(itr.hasNext()) { sum+=Integer.parseInt(itr.next().toString()); } System.out.println("total value is = " +sum 

Java Beginners

java applets - Java Beginners
find sum of elements in vector without using swing or jframes 14.write a java...java applets  1.write main method for display clock applet including... calculator using java codes?... 4.write a java application to open the file 

Java Beginners

java - Java Beginners
java  Q: write a program in java which input a positive natural N and output all combination of consecutive natural which add up to give N... of consecutive natural numbers available to sum upto "+num); else for(int i =0;i 

Java Beginners

Java Program - Java Beginners
Java Program  The numbers in the following sequence are called the fibonacci numbers . 0 , 1 , 1 , 2, 3 , 5 , 8 , 13 , ????.. Write.... (Hint : After the first two numbers in the series, each number is the sum 

JSP Servlet Questions

Sum - JSP-Servlet
Sum  Hi Guys, thank you all for support for us all. Please I want to sum up from a particular row from the database, get all the rows affected... = con.createStatement(); ResultSet res = st.executeQuery("SELECT SUM(amount) FROM 

Java Interview Questions

Beginners in Java
Beginners in Java  Hi, I am beginners in Java, can someone help me... tutorials for beginners in Java with example? Thanks.   Hi, want to be command over Java, you should go on the link and follow the various beginners 

Java Beginners

program - Java Beginners
program  take the value of x,y, and a then calculate and print the sum of the following series: x1/y2 + x2/y4 + x3/y6......20 terms.... actually the numbers after x and y are exponents...like x to the power 1 / y 

Java Beginners

add number - Java Beginners
(); int sum=a+b+c; System.out.println("Addition of three numbers= "+sum 

Java Beginners

java beginners - Java Beginners
the following links: http://www.roseindia.net/java/beginners/StringTokenizing.shtml http://www.roseindia.net/java/beginners/tokenizingjavasourcecode.shtml...java beginners  what is StringTokenizer? what is the funciton 

Java Beginners

3 Java Programs for Beginners
3 Java Programs for Beginners  Write a program that prompts the user... (inclusive) and their squares and the sum of their squares. Write a program...: "); int num2=input.nextInt(); int sum=0; System.out.println("Number 

Java Beginners

computers - Java Beginners
computers  write a program in java to find the sum of the given series taking the value of a and n from the console by the user. S=a/2+a2/3+a3/4....aN-1/N plzzz help me....!!  /** * * @author Gaurav */ public 

Advertisements Advertisements
 

 

 

DMCA.com