اخواني الاعزاء
انا مبتدىء بالبرمجه بالجافا
احاول كتابة برناج يقوم بجمع مصفوفه ومن ثم ضرب المجموع بمصفوفه ثانيه
ارجو المساعده
import javax.swing.*;
public class sumarray {
// main method begins execution of Java application
public static void main( String args[] )
{
int a[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
int b[] = { 5,4,3,2,1};
int total = 0;
int multi = 0;
// add each element's value to total
for ( int i = 0; i < a.length; i++ )
total += a[ i ];
for ( int j= 0 ; j < b.length; j++ )
multi = total * b[j]
JOptionPane.showMessageDialog( null,
"Total of array elements: " + total,multi ,
"Sum the Elements of an Array",
JOptionPane.INFORMATION_MESSAGE );
System.exit( 0 );
}
}