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

برنامج وسؤال #c

بدأه waly_misr في 3 يناير 2009 · 8 رد · 1,018 مشاهدة · في Microsoft Visual C#.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

بســم الله الـرحمــن الرحيــم

والسلام عليكــم ورحمـة الله وبركاتــه

اليكم البرمجة المبدئية لبرنامج بالـ#C لحساب الجمل للحرف العربي ويبين نوعه بإستخدام دالة

swich

===

ولكن لحرف واحد :wink:

===

والسؤال: هل يمكن تطوير هذا الكود ليحسب تلقائياً كلمة أو جملة بأكملها؟

بمعني أوضح ان يكون label3.Text عبارة عن مجموع كل الحروف المكتوبة في textBox1 وليس أول حرف فقط

=============

لتحميل البرنامج بالزر الأيمن وحفظ

=============

private void textBox1_TextChanged(object sender, EventArgs e)
		{
			switch (textBox1.Text)
			{
				case "":
					label3.Text = "00";
					label4.ForeColor = System.Drawing.Color.Gray;
					label4.Text = "تم المسح";
					break;
				case " ":
					label3.Text = "0";
					break;
				case "أ":
					int a = 1;
					label3.Text = a.ToString();
					label4.ForeColor = System.Drawing.Color.DarkOrange;
					label4.Text = "ناري";
					break;
				case "ا":
					a = 1;
					label4.ForeColor = System.Drawing.Color.DarkOrange;
					label4.Text = "ناري";
					break;
				case "ؤ":
					a = 1;
					label3.Text = a.ToString();
					break;
				case "ب":
					a = 2;
					label3.Text = a.ToString();
					label4.ForeColor = System.Drawing.Color.Tan;
					label4.Text = "ترابي";
					break;
				case "ج":
					a = 3;
					label3.Text = a.ToString();
					label4.ForeColor = System.Drawing.Color.PowderBlue;
					label4.Text = "هوائي";
					break;
				case "د":
					a = 4;
					label3.Text = a.ToString();
					label4.ForeColor = System.Drawing.Color.DodgerBlue;
					label4.Text = "مائي";
					break;
				case "ه":
					a = 5;
					label3.Text = a.ToString();
					label4.ForeColor = System.Drawing.Color.DarkOrange;
					label4.Text = "ناري";
					break;
				case "و":
					a = 6;
					label3.Text = a.ToString();
					label4.ForeColor = System.Drawing.Color.Tan;
					label4.Text = "ترابي";
					break;
				case "ز":
					a = 7;
					label3.Text = a.ToString();
					label4.ForeColor = System.Drawing.Color.PowderBlue;
					label4.Text = "هوائي";
					break;
				case "ح":
					a = 8;
					label3.Text = a.ToString();
					label4.ForeColor = System.Drawing.Color.DodgerBlue;
					label4.Text = "مائي";
					break;
				case "ط":
					a = 9;
					label3.Text = a.ToString();
					label4.ForeColor = System.Drawing.Color.DarkOrange;
					label4.Text = "ناري";
					break;
				case "ي":
					a = 10;
					label3.Text = a.ToString();
					label4.ForeColor = System.Drawing.Color.Tan;
					label4.Text = "ترابي";
					break;
				case "ك":
					a = 20;
					label3.Text = a.ToString();
					label4.ForeColor = System.Drawing.Color.PowderBlue;
					label4.Text = "هوائي";
					break;
				case "ل":
					a = 30;
					label3.Text = a.ToString();
					label4.ForeColor = System.Drawing.Color.DodgerBlue;
					label4.Text = "مائي";
					break;
				case "م":
					a = 40;
					label3.Text = a.ToString();
					label4.ForeColor = System.Drawing.Color.DarkOrange;
					label4.Text = "ناري";
					break;
				case "ن":
					a = 50;
					label3.Text = a.ToString();
					label4.ForeColor = System.Drawing.Color.Tan;
					label4.Text = "ترابي";
					break;
				case "س":
					a = 60;
					label3.Text = a.ToString();
					label4.ForeColor = System.Drawing.Color.PowderBlue;
					label4.Text = "هوائي";
					break;
				case "ع":
					a = 70;
					label3.Text = a.ToString();
					label4.ForeColor = System.Drawing.Color.DodgerBlue;
					label4.Text = "مائي";
					break;
				case "ف":
					a = 80;
					label3.Text = a.ToString();
					label4.ForeColor = System.Drawing.Color.DarkOrange;
					label4.Text = "ناري";
					break;
				case "ص":
					a = 90;
					label3.Text = a.ToString();
					label4.ForeColor = System.Drawing.Color.Tan;
					label4.Text = "ترابي";
					break;
				case "ق":
					a = 100;
					label3.Text = a.ToString();
					label4.ForeColor = System.Drawing.Color.PowderBlue;
					label4.Text = "هوائي";
					break;
				case "ر":
					a = 200;
					label3.Text = a.ToString();
					label4.ForeColor = System.Drawing.Color.DodgerBlue;
					label4.Text = "مائي";
					break;
				case "ش":
					a = 300;
					label3.Text = a.ToString();
					label4.ForeColor = System.Drawing.Color.DarkOrange;
					label4.Text = "ناري";
					break;
				case "ت":
					a = 400;
					label3.Text = a.ToString();
					label4.ForeColor = System.Drawing.Color.Tan;
					label4.Text = "ترابي";
					break;
				case "ة":
					a = 400;
					label3.Text = a.ToString();
					label4.ForeColor = System.Drawing.Color.Tan;
					label4.Text = "ترابي";
					break;
				case "ث":
					a = 500;
					label3.Text = a.ToString();
					label4.ForeColor = System.Drawing.Color.PowderBlue;
					label4.Text = "هوائي";
					break;
				case "خ":
					a = 600;
					label3.Text = a.ToString();
					label4.ForeColor = System.Drawing.Color.DodgerBlue;
					label4.Text = "مائي";
					break;
				case "ذ":
					a = 700;
					label3.Text = a.ToString();
					label4.ForeColor = System.Drawing.Color.DarkOrange;
					label4.Text = "ناري";
					break;
				case "ض":
					a = 800;
					label3.Text = a.ToString();
					label4.ForeColor = System.Drawing.Color.Tan;
					label4.Text = "ترابي";
					break;
				case "ظ":
					a = 900;
					label3.Text = a.ToString(); 
					label4.ForeColor = System.Drawing.Color.PowderBlue;
					label4.Text = "هوائي";
					break;
				case "غ":
					a = 1000;
					label3.Text = a.ToString();
					label4.ForeColor = System.Drawing.Color.DodgerBlue;
					label4.Text = "مائي";
					break;
			}
		}

تم تعديل هذه المشاركة بواسطة waly_misr في 3 يناير 2009 في 23:41

#2

أرجو الرد والتعليق علي الكود وهل يمكن تطوير الكود أم لا؟

#3

السلام عليكــم ورحمـة الله وبركاتــه

ياجماعة البرنامج دة عبارة عن تمرين بالنسبة لي علي لغة الـ #C

لذا أرجو المساعدة والرد

وفي فكرة أخري.....

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


string[] NumGommal = new string[] {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "20", "30", "40", "50", "60", "70", "80", "90", "100", "200", "300", "400", "500", "600", "700", "800", "900", "1000"};
string[] letters = new string[] {"أ","ب","ج","د","ه","و","ز","ح","ط","ي","ك","ل","م","ن","س","ف","ص","ق","ر","ش","ت","ث","خ","ذ","ض","ظ","غ"};

المشكلة اني اريد من label أن يكون مكتوب فيه مجموع الأحرف المكتوبة في textBox ولكن كيف تتم المقابلة بين

letters و NumGommal

أرجو الرد والمساعدة

#4

السلام عليكــم ورحمـة الله وبركاتــه

الموضوع مازال مفتوحاً ولم يرد أحد !!!!!!!!!

أرجوا الرد لأني متحير في الربط بين الحروف وما يساويها من أرقام ومازال الأمر يشغلني...

وقد يبدو لدي البعض عدم أهمية الموضوع .... ولكن الأهمية الكبري في كيفية تنفيذ الفكرة وليس في الفكرة نفسها

وإذا لم يكن الموضوع في غير مكانه فأرجوا من الإدارة إتخاذ اللازم من نقل أو حذف وإبلاغي بالنتيجة

#6

مشكور أخي الكريم System Down علي سرعة الرد........ وآسف علي تأخري في الرد عليك

#7

اخي الكريم والي مصر، الملف المرفق لا يمكن تحميله

انا مبتدئة مثلك وارغب ان استفيد من الفكرة التي تعمل عليها، اين وصلت بها، بامكاني مساعدتك

اخي shutdown هل لك ان تشرح اكثر عن dictionary كيف نقوم باستخدامه؟

#8

مشكورة أختي الكريمة pst على مرورك

لتحميل البرنامج بالزر الأيمن وحفظ

او ضعي هذا العنوان في شريط العنوان للمتصفح

http://members.lycos.co.uk/walymisr/upload...Application.exe

وفى انتظار شرح الفكرة وتوضيحها من الأخ shutdown

مشكورين لمروركم

#9

مرحباً أخواني الكرام .

مثال عن إستخدام الـ Dictionary :

 

 

[color= #009900;]{ 

    Dictionary[color= #339933;]<char[color= #339933;], char[color= #339933;]> MyDica [color= #339933;]= [color= #000000; font-weight: bold;]new Dictionary[color= #339933;]<char[color= #339933;], char[color= #339933;]>[color= #009900;]([color= #009900;])[color= #339933;]; 

 

    MyDica[color= #339933;].Add[color= #009900;]([color= #0000ff;]"A"[color= #339933;], [color= #0000ff;]"أ"[color= #009900;])[color= #339933;]; 

 

    Interaction[color= #339933;].MsgBox[color= #009900;](string[color= #339933;].Format[color= #009900;]([color= #0000ff;]"A in AR is {0}"[color= #339933;], MyDica[color= #009900;]([color= #0000ff;]"A"[color= #009900;])[color= #009900;])[color= #009900;])[color= #339933;]; 

[color= #009900;]}

حيث أن عليكم تعريف نوع ( المفتاح, و القيمة ) للـ Dictionary, كما ترى أننا إستخدمنا Char والتي تمثل متغيّر حرفي, لكن إذا كنتم تريدون إستخدام العملية بكلا اللغتين فأنصحكم بالإعتماد على قوائم أو مصفوفات حرفية .

بالتوفيق .

The important thing is not so much

that every child should be taught,

as that every child should be given the wish to learn.

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