يب طريقتك صح انا عملتها كدا :
package w6;
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner input=new Scanner(System.in);
int[] mid=new int[10];
int[] final1=new int[10];
int[] total =new int[10];
for(int c:mid)
{
System.out.println("enter mid");
mid[c]=input.nextInt();
}
for(int c:final1)
{
System.out.println("enter final");
final1[c]=input.nextInt();
}
for(int c:total)
{
total[c]=mid[c]+final1[c];
System.out.println("the total:" +total[c]);
}
// TODO code application logic here
}
}
|
جربت الكود حقك طلع خطأ التوتل،، جربي الكود حقي واعطيني رأيك ( بس بدون حش، أول مرة استخدم Array )

+ انتي محددة عدد الاختبرات 10، المفروض تخلي المستخدم هو إلي يدخل عدد الاختبارات