الأربعاء، 27 أبريل 2011

last quiz solution


below is nearly a  suggested solution for the last quiz, there are a bit differences , but idea is identical
good luck for all




using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;

namespace Hash_ArrayListPro
{
    class Program
    {
        public static Hashtable geo_info = new Hashtable(); 
        static void Main(string[] args)
        {
            for (int i = 0; i < 3; i++) 
            {
                Console.WriteLine("Enter country ");
                string country = Console.ReadLine();

                Console.WriteLine("Enter country area");
                object area = Console.ReadLine();

                geo_info.Add(country, area);


            } // end for

            Console.WriteLine("Geographic information are:");
            foreach (Object Key in geo_info.Keys)
            {
                Console.WriteLine(" {0} Area is :  {1}", Key, geo_info[Key]);

            }

            Console.WriteLine("enter the country name you want to modify its area");

            string key1 = Console.ReadLine();
            if (geo_info.Contains(key1))
            {
                geo_info[key1] = 111.1111;

                Console.WriteLine("Geographic information After Modification:");
                foreach (Object Key in geo_info.Keys)
                {
                    Console.WriteLine(" {0} Area is :  {1}", Key, geo_info[Key]);

                }
            }
            else
            {
                Console.WriteLine("Not exists Country");
            }
            
            
            ArrayList list = new ArrayList();
            list.Add("ali");
            list.Add(88);
            list.Add('B');

            foreach (object x in list)
                Console.WriteLine(x);


            Console.WriteLine(list.Count);

            Console.ReadLine();
            list.Insert(1,"hasan");
            list.Reverse();
            foreach (object x in list)
                Console.WriteLine(x);
  




        }// end main
    }
}

الأحد، 3 أبريل 2011

quize 4 suggested solution



using System;
using System.Collections.Generic;
using System.Text;

namespace quize4
{
    class MobilePhone
    {
        int cost;
        int serial;
        protected string color;
        public MobilePhone()
        {
        Console.WriteLine("default values is cost =0, serial=0 and color=non");
            cost = 0;
            serial = 0;
            color = "non";
        }
        public MobilePhone(int c, int s, string co)
        {
            cost = c;
            serial = s;
            color = co;
             Console.WriteLine("general mobile object created");
             Console.WriteLine("{0},{1},{2}",cost,serial,color);

        }
        public int Cost
        {
        set {cost=value;}
        get{return cost;}
         }

       public int Serial{
        set { serial = value; }
        get { return serial; }
   
    }


        public void ComputePrice(double tax)
        {
            Console.WriteLine("total price in piaster is :");
            Console.WriteLine(tax + cost);
           
        }

    }

    class NokiPhone:MobilePhone
    {
        string model;
      
        public NokiPhone(  int c, int s,string co, string m):base(c,s,co)
        {
            model = m;
           Console.WriteLine(model);
        }



        public new void ComputePrice(double tax)
        {
            Console.WriteLine("total price in JD is :");
         
            Console.WriteLine(tax + Cost/100);
          

        }
   
    }

    class  SonyPhone: MobilePhone
    {

        public SonyPhone()
        {
            color = "blue";
            Console.WriteLine("\nthe sony color is {0} \n",color);
         }
   
    }

    class Program
    {
        static void Main(string[] args)
        {
            MobilePhone m = new MobilePhone(20,11,"red");
            m.ComputePrice(0.4);

            NokiPhone n = new NokiPhone(20, 22, "yellow","6300");
           
            n.ComputePrice(0.4);

       
         
            SonyPhone s = new SonyPhone();



        }
    }
}

الاثنين، 7 مارس 2011

quize2 solution


using System;
using System.Collections.Generic;
using System.Text;


namespace quize2
{

class mytime
{

private int hour;
private int minute;
private int second;



public int H {

get { return hour; }

set

{
  if (hour >= 0 && hour <= 24)

{ hour = value; }

else

{ Console.WriteLine("invalid time"); }

}
}// end h pro



public int M

{  get { return minute; }

set

{  if (value >= 0 && value <= 60)

{ minute = value; }

else

{ Console.WriteLine("invalid time entered "); }

}

 
}// end min pro

public int S

{ get { return second; }

set
{
if (value >= 0 && value <= 60)

{ second = value; }

else

{ Console.WriteLine("invalid time entered "); }

}

}// end sec pro


}//end time class



class Program

{  static void Main(string[] args)

{ mytime t = new mytime();

Console.WriteLine("enter hour ,minutes and the seconds");

t.H=int.Parse(Console.ReadLine());

t.M =int.Parse( Console.ReadLine());

t.S = int.Parse(Console.ReadLine());



Console.WriteLine("time is {0}:{1}:{2}\n",t.H, t.M, t.S);

}

}//end main

}


الاثنين، 14 فبراير 2011

Excel exercise


For CIS:100 students the following is a table sample you can exercise the required skills through it , the editor for this blog is not professional enough so you find the columns under each other not formatted as table

Best wishes for all 

Product Name  
X
Y
Z
P
R
Q

سعر  التكلفة Cost ( JD)
20.2
 10
 13
 212
 50.2
 44              

 Profit Rate
 0.12
 0.02
 0.33
 0.5
 0.02
 0.04  

الاثنين، 24 يناير 2011

استراتيجيات النمل


استـراتيجـيات النـمــــــل‎

بعث الله المخلوقات ليست لتكون دوابا مسخرة لنا فقط ولكنها ايضا بتاملنا لها تعلمنا الكثير مما انعم الله عليها به من سلوكيات وتصرفات ، بات الحيوان اليوم مصدرا مهما ملهما باستراتيجياته السلوكية للعلماء لدرجة ان كثيرا من الخوارزميات في عالم الحاسوب مثلا طورت بناء على سلوكيات النمل او غيره من المخلوقات .. لا نستطيع حقا الا ان نقول سبحان الله ... وكمحاولة لنقل بعضا من هذه الاستراتيجيات علها تحمل لنا هدية من الله سبحانه وتعالى لنا اقدم هذه المعلومات .. سائلا الله ان ننتفع بها جميعا وان تكون لنا عبرة وعظة ..

الإستراتيجية الأولـى: الـنـمـل لا يـنـسـحـب أو يـسـتـسـلـم أبـداً

- إذا أحتجز في مكان معين أو حاولت إيقافه سيبحث عن طريق آخر.
- سيحاول التسلق أو المرور من أسفل أو من الجوانب.
- وسيستمر في البحث عن طريق آخر.


لذلك:لا تستسلم في البحث عن طريق آخر لتصل إلى هدفك.

                                      *****

الإستراتيجية الـثـانـيـة :النـمـل يفـكـر في الـشـتاء طول فصل الصيف
- من الغباء أن تـعـتـقـد أن فصل الصيف سيستمر إلى الأبد.
- لذلك فإن النمل يجمعون طعام الشتاء في منتصف فصل الصيف.


   لذلك:من المهم أن تكون واقعياً, فكر في المستقبل.

                                       *****

الإستراتيجية الـثـالـثـة:النـمل يفكـر في فصل الصيف طول فصل الشـتاء

- خلال فصل الشتاء, النمل يذكرون أنفسهم بأن ”فصل الشتاء لن يستمر  طويلاً , وقريباً سنخرج من هنا“
- ويخرج النمل في أول يوم دافئ.
- وعندما يعود البرد مرة أخرى يعودون إلى مساكنهم , لكنهم يعودون للخروج  مرة أخرى في أول يوم دافئ.
  
    لذلك: كـن دائـمـاً إيـجـابـيـاً

                                      *****

الإستراتيجية الـرابـعـة:كـل الـذي تـسـتـطـيـع أن تـفـعـلـه.

- كم تجمع النملة خلال فصل الصيف لتستعد لفصل الشتاء؟
- كل الذي تستطيع فعله.

لذلك:أفعل كل الذي تستطيع فعله ... وزيادة!!

                             ********************
بــاخــتــصــار ..

1) لا تستسلم أبدا.
ً2) فـكـر فـي الـمـسـتـقـبـل. 
3) كـن إيـجـابـيـاً. 
4) أفـعـل كل ما تـسـتـطـيـع فـعـله.

الجمعة، 21 يناير 2011

من اسرار السعادة




من يرد الرضا والسعادة الحقيقية في حياته

فليتذكر دائما وهو منغمس في جهاده وكفاحه من أجل النجاح

وإن لم يعترف الناس بفضلك وإنجازاتك في حياتك أو بعد مماتك

فلتتذكر دائماَ بأن الله لا يضيع أجر المحسنين


وكما قال حبيبنا رسول الله :(البر لا يبلى والذنب لا ينسى 

والديان لا يموت,افعل ما شئت فكما تدين تدان)

الخميس، 20 يناير 2011

لا تطمئني .. رسالة لاخواني الشباب والفتيات

لا تطمئني


نقلتها لانها رائعة وتحمل معنى عميق جدا والتجارب والوقائع في الحياة هي من تعكس صدق هذا المعنى .. صدقوني يا جماعة ليست القضية تنظيرا او من باب القواعد المثالية التي نحتفظ فيها للمشايخ او العلماء الامر واقعي وانظروا حولكم للاسر
اتمنى ان تكون  احد معايير اختيار الزوج الصالح لاخواتي الشباب والفتيات 


 لا تطمئني 

إلى رجل انصرف عن طاعة الله مأخوذا بدنياه...

إن من لا يعترف بفضل الله عليه لن يعترف بجميلك...

ومن لا يستحيي من ملاقاة الله مذنبا، سيذنب في حقك من دون شعور بالذنب...

ومن ترك صلاته وصيامه بذرائع واهية، وتربى عليها، سيعثر حين يشاء على الذرائع التي يحتاج إليها لتركك...

من لا يرى أبعد من حياته ولا يحسب للآخرة حسابا، هو في الحب لا يرى أبعد من لحظته ، ولن يصدق في التزامه معك أبعد من يومه...

ومن نسي أن الله يراه، سينسى أن يرى دموعك حين تبكين من ظلمه...

ومن لم يعتد التضرع إلى الله طلبا للغفران، لن تجدي معه عند الحاجة تضرعاتك.