❥͢ ❈↡< C# > برمجة
271 subscribers
12 photos
23 links
صل اللَّـه وسلم على سيدنا ونبينا محمد ﷺ‏

قناة لنشر الاسئلة والحلول للبرمجة بلغة #C

•┈┈┈•❈••✾••❈•┈┈┈•
تم انشاء القناة: 2019/11/6 . 8:30 م
•┈┈┈•❈••✾••❈•┈┈┈•

مكتبة لغات البرمجة. @language_barmaja
Download Telegram
This media is not supported in your browser
VIEW IN TELEGRAM
إ₰...👨🏻‍💻CODE👩🏻‍💻...₰❥

#الــلــوائــح_Lists :-

1⃣ التصريح عن اللوائح
list <type >اسم اللائحة =new list <type> ();

2⃣ التعامل مع اللوائح

بشكل أساسي تتميز اللوائح عن المصفوفات بإمكانية الإضافة والحذف
وذلك من خلال
Add & Remove & RemoveAt.

* تعمل Remove بحذف عنصر فعلي باللائحة .
* تعمل RemoveAt بحذف موقع باللائحة حيث اول عنصر باللائحة ترتيبة 0 .

•┈┈┈•❈••✦✾✦••❈•┈┈┈•
❥➺┊ @barmaja_Csharp
•┈┈┈•❈••✦✾✦••❈•┈┈┈•
This media is not supported in your browser
VIEW IN TELEGRAM
إ₰...👨🏻‍💻CODE👩🏻‍💻...₰❥

أنواع بيانات خاصة بالمبرمج :-

للتعامل مع البيانات الثابتة نستخدم ما
يسمى المعددات Enumerations
أما المتغيرة ومتعددة الفروع من البيانات فنستخدم التراكيب Structrues.

#اولآ : التراكيب Struct :-

struct اسم التركيب
{
Public Var ;
.
.
}

*متغيرات التركيب عامة حتى نستخدمها في كافة توابع وإجراءات المشروع.


•┈┈┈•❈••✦✾✦••❈•┈┈┈•
❥➺┊ @barmaja_Csharp
•┈┈┈•❈••✦✾✦••❈•┈┈┈•
This media is not supported in your browser
VIEW IN TELEGRAM
إ₰...👨🏻‍💻CODE👩🏻‍💻...₰❥

كود توضيح نوع البيانات struct :-
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;

namespace CSharp
{

public static class Program
{
struct Student
{
public string Home;
public int Age;
public BirthDay Birth;
public override string ToString()
{
string str;
str = string.Format("Home: {0}, Age: {1}, BirthDay: {2}/{3}/{4}",
Home, Age, Birth.Day, Birth.Month, Birth.Year);
return str;
}
}
struct BirthDay
{
public int Day, Month, Year;
}
static void Main(string[] args)
{
Student wasam = new Student();
wasam.Home = "M";
wasam.Age = 20;
wasam.Birth.Day = 1;
wasam.Birth.Month = 1;
wasam.Birth.Year = 2000;
Console.WriteLine(wasam.ToString());
Console.ReadKey();
}
}
}

•┈┈┈•❈••✦✾✦••❈•┈┈┈•
❥➺┊ @barmaja_Csharp
•┈┈┈•❈••✦✾✦••❈•┈┈┈•


إ₰...Output....₰❥

Home: M, Age: 20, BirthDay: 1/1/2000
This media is not supported in your browser
VIEW IN TELEGRAM
إ₰...👨🏻‍💻CODE👩🏻‍💻...₰❥

#المعددات Enum :
تستخدم مع مجموعة من القيم محددة لا تتغير ولا تزداد ولا تنقص
ومصرّح عنها سابقا، ومرتبة وفق ترتيب معين يبدأ من 0 .

enum اسم المعدد
{
enum's Values;
.
.
}

•┈┈┈•❈••✦✾✦••❈•┈┈┈•
❥➺┊ @barmaja_Csharp
•┈┈┈•❈••✦✾✦••❈•┈┈┈•
This media is not supported in your browser
VIEW IN TELEGRAM
إ₰...👨🏻‍💻CODE👩🏻‍💻...₰❥

#كود_توضيع_الـenum :-

using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;

namespace CSharp
{

public static class Program
{
enum Answer
{
Yes = 1, Ok = 1, True = 1,
No = 0, False = 0,
}
static void Main(string[] args)
{
Answer a = Answer.Ok;
if (a == Answer.Yes)
Console.WriteLine("Accepted!");
else
Console.WriteLine("Refused!");
Console.ReadKey();
}
}
}

•┈┈┈•❈••✦✾✦••❈•┈┈┈•
❥➺┊ @barmaja_Csharp
•┈┈┈•❈••✦✾✦••❈•┈┈┈•


إ₰...Output....₰❥

Accepted!
This media is not supported in your browser
VIEW IN TELEGRAM
إ₰...👨🏻‍💻#C👩🏻‍💻...₰❥


1⃣ الطرق او الدوال Functions :
* تستقبل متغيرات وتجري عليها بعض العمليات
* تعطي نتيجة return من نفس نوع الدالة
( double, string, int )

2⃣ الإجراءات Procedures
* لا تعيد نتيجة( لا تملك الكلمةreturn )
* ولا نوع لها تسبق بالكلمة المحجوزة void


#اولآ :الصيغة العامة للتصريح عن الدوال :-

(متغيرات_الدالة) اسم_الدالة نوع_الدالة
{
Code
.
.
return قيمة };

القيمة المعادة بعد كلمة return هي عبارة عن متغير يحمل قيمة نتيجة إجراء بعض العمليات.

#ثانيآ : الصيغة العامة للتصريح عن الإجراء :-

void name_pro (متغيرات_الأجراء)
{
Code
.
.
}

* كما هو الحال في بنى التحكم وبعض حلقات التكرار
فالطرق لا تلحق بفاصلة منقوطة.

*في الإجراءات لا توجد الكلمة return لانها لا تعيد أي قيمة.

•┈┈┈•❈••✦✾✦••❈•┈┈┈•
❥➺┊ @barmaja_Csharp
•┈┈┈•❈••✦✾✦••❈•┈┈┈•
This media is not supported in your browser
VIEW IN TELEGRAM
إ₰...👨🏻‍💻CODE👩🏻‍💻...₰❥

using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;

namespace CSharp_Shell
{

public static class Program
{
static void MyProc(int y)
{
y += 10;
}
static void Main(string[] args)
{
int x = 10;
MyProc(x);
Console.Write(x);
Console.ReadKey();
}
}
}

•┈┈┈•❈••✦✾✦••❈•┈┈┈•
❥➺┊ @barmaja_Csharp
•┈┈┈•❈••✦✾✦••❈•┈┈┈•
إ₰...Output....₰❥
Anonymous Quiz
37%
10
59%
20
4%
15
This media is not supported in your browser
VIEW IN TELEGRAM
إ₰...👨🏻‍💻CODE👩🏻‍💻...₰❥

using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;

namespace CSharp
{

public static class Program
{
static void MyProc(ref int y)
{
y += 10;
}
static void Main(string[] args)
{
int x = 10;
MyProc(ref x);
Console.Write(x);
Console.ReadKey();
}
}
}

•┈┈┈•❈••✦✾✦••❈•┈┈┈•
❥➺┊ @barmaja_Csharp
•┈┈┈•❈••✦✾✦••❈•┈┈┈•
إ₰...Output....₰❥
Anonymous Poll
42%
10
55%
20
3%
15
This media is not supported in your browser
VIEW IN TELEGRAM
إ₰...👨🏻‍💻CODE👩🏻‍💻...₰❥

#مجالات_الأسماء Namespaces :-

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

*لإنشاء مجال اسماء اكتب الكلمة namespace ثم اسم مجال الأسماء
تليها فئاتها محاطة بإشارتي { }
تحددان بداية ونهاية مجال الأسماء هذا.

*ولاستخدام مجال الأسماء الذي أنشأته في مجال أسماء آخر عليك تضمينه في بداية البرنامج بالكلمة using .

•┈┈┈•❈••✦✾✦••❈•┈┈┈•
❥➺┊ @barmaja_Csharp
•┈┈┈•❈••✦✾✦••❈•┈┈┈•
This media is not supported in your browser
VIEW IN TELEGRAM