הרשם שאלות ותשובות רשימת חברים לוח שנה הודעות מהיום

חזור   הוסטס - פורום אחסון האתרים הגדול בישראל > עיצוב גראפי, תכנות על כל שפותיו וקידום ושיווק אתרים > פורום תיכנות

   
|!|

 
 
כלים לאשכול תצורת הצגה
Prev הודעה קודמת   הודעה הבאה Next
ישן 05-10-06, 16:20   # 1
CSite.co.il
משתמש - היכל התהילה
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
הודעות: 1,816

CSite.co.il לא מחובר  

עזרה בהרצת קוד JAVA.

אני עובד עם eclipse, וכנראה ה - console לא עובד אצלי טוב.

הקוד הבא:
קוד:
import java.lang.Math;
import javax.swing.JOptionPane;

public class hello {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int a,b,c,m,f,f2,g,f3,f4;
		f = 0;
		a = Integer.parseInt(JOptionPane.showInputDialog("insert first number"));
		b = Integer.parseInt(JOptionPane.showInputDialog("insert sec number"));
		c = Integer.parseInt(JOptionPane.showInputDialog("insert third number"));
		m = ((b*b)* -(4)*(a*c));
		g = (int)Math.sqrt((double)m);
        
		
		if (g > 0)
		{
			f = (-b + g)/(2*a) ;
		    f2 = (-b - g)/(2*a);
		    System.out.print("the first result is");
		    System.out.print(f2);
		    System.out.print("the sec result is");
		    System.out.print(f);
		    System.out.print("the equation is positive");
		}
		if (g < 0)
		{
			f3 = (-b + g)/(2*a);
		    f4 = (-b - g)/(2*a);
		    System.out.print("the first result is");
		    System.out.print(f4);
		    System.out.print("the sec result is");
		    System.out.print(f3);
		    System.out.print("the equation is negative");
		    
		}
		}
	}
זה משוואה ריבועית... x12..

תודה לעוזרים!
 
 

חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים)
 


חוקי פירסום
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is מופעל
סמיילים הם מופעל
[IMG] קוד מופעל
קוד HTML מכובה

קפיצה לפורום


כל הזמנים הם GMT +2. הזמן כעת הוא 00:14.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ