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

messier the BMI

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

Your task is to design, write, and run java algorithm to messier the body mass index (BMI) using an interface to allow the user to key in the values of the user weight in kilograms and value of the user height in centimeters to calculate the BMI and store it in an array. Your algorithm should generate different messages based on the BMI values:

· BMI = <18.5 (your weight is under weight)

· BMI = 18.5-24.9 (your weight is normal weight)

· BMI = 25-29.9 (your weight is over weight)

· BMI = 30 & above (your are obese)

أنا حاولت أحله وهذي طريقتي فالحل ياريت حد يساعدني ضروري :

package assig;

import javax.swing.JOptionPane;

public class BodyMass {

static double w,h;

public static void main(String[]args)

int[]w=new int;

int[]h=new int;

getWeight(w);

getHeight(h);

double getBMI=BMI(w,h);

}

public static void getWeight(Double[]w){

String s1 = JOptionPane.showInputDialog(" Excuse me ,,, " + " \n Please enter your weight :");

for(int r=0; r<w.length; r++){

double weight= Double.parseDouble(s1);

}

}

public static void getHeight(Double[]h){

String s2 = JOptionPane.showInputDialog(" Excuse me ,,, " + " \n Please enter your Height :");

for(int r=0; r<h.length; r++){

double height = Double.parseDouble(s2);

}

}

public static double getBMI(double[]BMI) {

for(int r=0; r<BMI.length; r++){

if(BMI[r]<=18.5){

JOptionPane.showMessageDialog( null,BMI+ " Your weight is under weight");

if(BMI[r]==18.5-24.9){

JOptionPane.showMessageDialog( null,BMI+ " Your weight is normal weight");

if(BMI[r]==25-29.9){

JOptionPane.showMessageDialog( null,BMI+ " Your weight is over weight");

if (BMI[r]>=30){

JOptionPane.showMessageDialog( null,BMI+ " Your are obese");

}

}

}

}

}

return w/(h*h)*1000;

}

}

شكرآ لكم

تم تعديل هذه المشاركة بواسطة روح السجايا في 14 مارس 2011 في 20:17

#2

أختي الكريمة موضوعك تشوبه الكثير من علامات الاستفهام

واهم شي يا اختي انه لازم تستخدمي اللغة العربية في طرح سؤالك او لدى شرح المشكلة التي تواجهكي

وعلى كل حال يا ريت تتفضلي بقرآة ما يلي:

قواعد طرح المشاركات

http://www.arabteam2...showtopic=29343

تم تعديل هذه المشاركة بواسطة vector_ever في 14 مارس 2011 في 21:30

إذا نظــرتَ نيـوب اللـّيـثِ بـارزةً         فـلا تظــنَنَ أَنَّ اللـّيـــثَ يبْتسـِـــمُ


 


 


رسم المخططات البيانية بواسطة الجافا


 


كتاب تحليل وتصميم نظم المعلومات


#3

أخي الكريم نحن دراستنا بالإنجليزية لذا يصعب علي ترجمة النص وهذا ما تعودت عليه

#4
روح السجايا كتب:

أخي الكريم نحن دراستنا بالإنجليزية لذا يصعب علي ترجمة النص وهذا ما تعودت عليه

أختي الكريمة والله كلنا دراستنا باللغة الانجليزية وغيرها من اللغات الاجنبية

لكن لغتنا العربية تستحق منا ان نعيد لها حقا واحترامها واجب علينا

إذا نظــرتَ نيـوب اللـّيـثِ بـارزةً         فـلا تظــنَنَ أَنَّ اللـّيـــثَ يبْتسـِـــمُ


 


 


رسم المخططات البيانية بواسطة الجافا


 


كتاب تحليل وتصميم نظم المعلومات


#5
// BodyMass.java

package assig;
import javax.swing.JOptionPane;

public class BodyMass {


   public static void main(String[] args){

   	double values[] = new double[]{1,1};
	double BMI = 0;

	try{

     	String s1 = JOptionPane.showInputDialog(" Excuse me ,,, " + " \n Please enter your weight :");
   values[0]  = Double.parseDouble(s1);

   String s2 = JOptionPane.showInputDialog(" Excuse me ,,, " + " \n Please enter your Height :");
   values[1]  = Double.parseDouble(s2);

     	BMI = values[0] / values[1]; // = weight / height

     	if(BMI <= 18.5){
            	JOptionPane.showMessageDialog( null , BMI + " Your weight is under weight");
     	}else if(BMI > 18.5 && BMI <= 24.9){
            	JOptionPane.showMessageDialog( null, BMI + " Your weight is normal weight");
   }else if( BMI > 25 && BMI <= 29.9){
            	JOptionPane.showMessageDialog( null, BMI + " Your weight is over weight");
   }else if (BMI >= 30){
            	JOptionPane.showMessageDialog( null, BMI + " Your are obese");
        	}

	}catch(Exception e){
    	System.err.println(e.getMessage());
	}


   }
}

هذا ما فهمته من السؤال

ضعيف فى الانجليزى هههههههههه

بالتوفيق


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

الأنفال ۳۳                                  
 

#6

شكرآ أستاذ محمد ع المحاوله

سأحاول جاهدة في فهمه مرة أخرى

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