بسم الله الرحمن الرحيم .
السسلام عليكم ورحمة الله وبركاته ..~
الاستاذه اعطتنا مجموعه اسئله للواجب والتسليم بكره ..طبعا انا حليتهم لكن متاكده ان عندي غلطات او نقص بخطوات الحل ...~
ياليت اللي عنده خلفيه يصححها لي ..لان التسليم بكره وضروري الحل يكون صحيح ...~
السؤال الاول ../
write a method to sum diagonal elemnts of a 2 dimensional array ..the header of a method as follow ::
public static double sum Diagonal(double[][]x
الحل ../
import javax.swing.*;
class sumDiagonal{
public static double sumDiagonal(double[][]x){
int[][]x=JOptionPane.showInputDialog("Enter the number of rows and colomn.");
int[][]x=new int[][];
for(int i=0;i<x.length ;i++){
for(int j=0 ;j<x.length ;j++){
sum+=array[j];
}
}
}
for(int i=0;i<x.length ;i++){
for(int j=0 ;j<x.length ;j++)
System.out.print(x[j]+" ");
System.out.print("\n");
}*********
السؤال الثاني ../
write the program that define 2-D array 4X4 with integer numbers and then write the folloing methods:
1\ fill array(): fill the first 3 columns of the array with integer number
2\ calc (): calculate each elemnts of column 4 by adding up the valus of 3 first elemnt in the same row>>
3\printArray:to print the array elemnt ..
الحل../
طبعا هنا ماعرفت اضيغ اللي داخل الميثود فخليتهم فاضين .. ياليت تفيدوني .
***************
السسؤال الثالث ../
compute the sum of each rows of 2 dimensial array and find the rows index which has the mimimum \ maxmum value of the sum ..
الحـــل../
import.javax.swing.*;
class Ques6{
public static void main(String args[]){
int[][]x= new int[size][size];
int i=JOptionPane.showInputDialog("Enter the number of rows.");
int j=JOptionPane.showInputDialog("Enter the number of columns.");
for(i=0 ;i<size ;i++)
for(j=0 ;j<size ;j++){
tot+ ==A[j];
max=tot[0];
min=tot[0];
}}
for(i=0;i<size ;i++)
for(j=0;j<size ;j++)
System.out.print("maximum value"+max);
System.out.print("minimum value"+min);
}والله يعطيكم العافيه .. لا تخلوني بليز .. وشكرا مقدما



