تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
برنامج المتغيرات المركبة =>>الاعداد المركبة
#1
بسم الله الرحمن الرحيم
السلام عليكم ...
اقدم لك عملي المتواضع هذا كاول مشاركة لي في المنتدىSmile
اتمنى يعجبكم!!

complex numbers>>> complex variables
فكرة البرنامج بسيطة،الهدف منها هو حل العمليات الجبرية + ، - ،* لاي عددين مركبين
مع مقدمة بسيطة للاعداد المركبة وقوانينها ...


كود :
import javax.swing.*;
class complex_varuables
{
    public static void main(String[]args)
    {
        
        
        
        
        JOptionPane.showMessageDialog(null,"\n\n \t\t                    \t\t         \t\t             ÈÓã Çááå ÇáÑÍãä ÇáÑÍíã            \n\n  ÞÇá ÊÚÇáì:(æÞá ÑÈí ÒÏäí ÚáãÇ)  \n                                      ÕÏÞ Çááå ÇáÚÙíã                      \n\n\n  \n\n  ÇáãÈÑãÌ :  íæÓÝ ãÕØÝì íæÓÝ            \n \t\t\t\t\t\t\t\t\t                 íÞÏã                            \n\n\n\n");
        
            
        
        JOptionPane.showMessageDialog(null,"\n                   complex variables\n                  ********************\n                  ********************\n\n           System in complex numbers                       \t\t\t\t\n\n\n\n\n\n");
        
        String X,Y,X2,Y2;
        int x,y,z,i,x2,y2;
        
        
        
        
        
        
        
JOptionPane.showMessageDialog(null,"We can consider a complex number as having the form z=x+iy \nwhere::\n\n x and y are real numbers  \n i is called the imaginary unit");
JOptionPane.showMessageDialog(null,"Enter your  first complex number");
X=JOptionPane.showInputDialog(null,"enter value for x");
Y=JOptionPane.showInputDialog(null,"enter value for y");
x=Integer.parseInt(X);
y=Integer.parseInt(Y);





JOptionPane.showMessageDialog(null,"your  first complex number is Z="+x +"+"+y+"i");


JOptionPane.showMessageDialog(null,"Enter your  second complex number");
X2=JOptionPane.showInputDialog(null,"enter value for x");
Y2=JOptionPane.showInputDialog(null,"enter value for y");
x2=Integer.parseInt(X2);
y2=Integer.parseInt(Y2);
JOptionPane.showMessageDialog(null,"your  second complex number is Z="+x2 +"+"+y2+"i");



JOptionPane.showMessageDialog(null,"Fundamental Operations with Complex Numbers is ");
JOptionPane.showMessageDialog(null," (1) Addition : \n\n(x1+i y1)+(x2+i y2) = x1+i y1 + x2+i y2 = (x1+x2)+(y1+y2)i  ");
JOptionPane.showMessageDialog(null,"In your problem \n\naddition for\nyour  first complex number is Z="+x +"+"+y+"i  \nand\n your second complex number is Z="+x2 +"+"+y2+"i  is \n\n Z="+(x+x2)+"+"+(y+y2)+"i");



JOptionPane.showMessageDialog(null," (2) Subtration : \n\n(x1+i y1)-(x2+i y2) = x1+i y1 - x2-i y2 = (x1-x2)+(y1-y2)i  ");
JOptionPane.showMessageDialog(null,"In your problem \n\nSubtration for\nyour  first complex number is Z="+x +"+"+y+"i  \nand\n your second complex number is Z="+x2 +"+"+y2+"i  is \n\n Z="+(x-x2)+"+"+(y-y2)+"i");



JOptionPane.showMessageDialog(null," (3) Multiplcation : \n\n(x1+i y1)(x2+i y2) = x1x2+ x1y2 i+ i y1x2+ y1y2 i^(2) = (x1x2-y1y2)+(x1y2+y1x2)i  ");
JOptionPane.showMessageDialog(null,"In your problem \n\nMultiplcation for\nyour  first complex number is Z="+x +"+"+y+"i  \nand\n your second complex number is Z="+x2 +"+"+y2+"i  is \n\n Z="+((x*x2)-(y*y2))+"+"+((x*y2)+(y*x2))+"i");
JOptionPane.showMessageDialog(null,"Writen by The programmer: Yousif.M.yousif");

        }
    
    }

[b]ملاحظة
* صممت البرنامج لحل تمرين رقم 1 (اعمال السنة) في كورس complex numbers
*جاري تطوير البرنامج باستخدام واجهات المستخدمينGUI

*و ان شاء الله سوف يتطور اكثر باستخدام VBBig GrinBig Grin
[/b]


_________________________________________________________________________
يوسف مصطفى يوسف النعيم (Yousif Mustafa yousif)
[ATTACH=CONFIG]900[/ATTACH]
سبحان الله وبحمده سبحان الله العظيم


الملفات المرفقة صورة/صور
   
الرد }}}
تم الشكر بواسطة:
#2
السلام عليكم

تستطيع من خلال الدوت نت بناء Structure ولتسمه ComplexNumber

ومن الجميل أن تعرف المعاملات داخل هذا التركيب(المعاملات هي = و + و - و < و > ...)

مثال
PHP كود :
Public Structure ComplexNumbers
    
Public Shared Operator +(ByVal Num1 As ComplexNumbersByVal Num2 As ComplexNumbers) As ComplexNumbers

    End Operator
End Structure 
الرد }}}
تم الشكر بواسطة:
#3
شكرا .
(( نحن قوم أعزنا الله بالإسلام فمهما ابتغينا العزة بغيره أذلنا الله )) .. 











الرد }}}
تم الشكر بواسطة:


التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم