الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

أرجو المساعده من الخبراء المختصين

بدأه عاصم قاسم في 22 أبريل 2011 · 4 رد · 431 مشاهدة · في JavaSE
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم الرجاء المساعدة في هذا الموضوع

If NOT (both x and y are equal zero)

Display a message “You Win The Game”

في هذه النقطة انا قمت بالمحاولة وكتابة الكود بهذه الطريقة فأرجو من الخبراء مساعدتي في التصحيح

import javax.swing.*;

public class EvalScore {

double win = 0;

int x = 0;

int y = 0;

String scoreStr = JOptionPane.showInputDialog(null, "You Win The Game");

win = Integer.parseInt(scoreStr);

if (x >= 0 && y <= 0) {

}

System.exit(0);

}

}

#2

يا اخى الموضوع ماهو محتاج خبراء

import javax.swing.*;

public class EvalScore {

int x = 0;
int y = 0;
String scoreStr = JOptionPane.showInputDialog(null, "Guess the number x :");
        	x = Integer.parseInt(scoreStr);


scoreStr = JOptionPane.showInputDialog(null, "Guess the number y :");
  y = Integer.parseInt(scoreStr);

  if(x != 0 && y != 0) {

System.out.println("You Win The Game");

   	} 
        System.exit(0);
        }
}

تم التعديل

بالتوفيق

تم تعديل هذه المشاركة بواسطة MOHAMED FATHEI في 29 أبريل 2011 في 19:33


﴿وَمَا كَانَ اللَّهُ لِيُعَذِّبَهُمْ وَأَنْتَ فِيهِمْ ۚ وَمَا كَانَ اللَّهُ مُعَذِّبَهُمْ وَهُمْ يَسْتَغْفِرُونَ﴾

الأنفال ۳۳                                  
 

#3

جزاك الله خيرا ووفقك الله لما يحب ويرضى

#4

أخي العزيز بالنسبة لهذه

x = Integer.parseInt(scoreStr);

بالبرنامج يعطيني خطأ فما رأيك أرجو الافادة وشكرا

#5

اخي هدا هوا الكود الصحيح

و كان هناك خطاء في استخدام if

import javax.swing.*;

class arabteam 
{



	public static void main(String args[])
	{
		int x = 0;
		int y = 0;
		String scoreStr = " " ;
		scoreStr = JOptionPane.showInputDialog(null,"Guess the number x :");
	    x = Integer.parseInt(scoreStr);


	    scoreStr = JOptionPane.showInputDialog(null, "Guess the number y :");
	    y = Integer.parseInt(scoreStr);

	    if (x != 0 && y != 0) 

		  JOptionPane.showMessageDialog(null,"You Won the Game") ; 
	    else
	    JOptionPane.showMessageDialog(null,"You Lost the Game") ;


	}
}

مواضيع مشابهة

عدد الزوار حالياً

المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية

—الإجمالي—أعضاء مسجّلون—زوار بدون تسجيل

جارٍ التحقق من المتواجدين…