Podcast
Questions and Answers
ما هي الطريقة الصحيحة للاعلان عن متغير في لغة #C؟
ما هي الطريقة الصحيحة للاعلان عن متغير في لغة #C؟
- اسم المتغير
- نوع البيانات اسم المتغير (correct)
- اسم المتغير نوع البيانات
- نوع البيانات
ماذا يعني أن المتغيرات حساسة لحالة الأحرف في لغة #C؟
ماذا يعني أن المتغيرات حساسة لحالة الأحرف في لغة #C؟
- يمكن استخدام أي حالة من الأحرف في اسم المتغير
- لا يمكن استخدام الأحرف الصغيرة في أسماء المتغيرات
- التمييز بين الأحرف الكبيرة والصغيرة في اسم المتغير مهم (correct)
- يجب أن يبدأ اسم المتغير بحرف كبير
أي من الخيارات التالية يعتبر اسم متغير غير صالح في لغة #C؟
أي من الخيارات التالية يعتبر اسم متغير غير صالح في لغة #C؟
- _myVariable
- 1myVariable (correct)
- MyVariable
- myVariable
ما هي الكلمة المفتاحية المستخدمة لتعريف ثابت في لغة #C؟
ما هي الكلمة المفتاحية المستخدمة لتعريف ثابت في لغة #C؟
أي نوع من البيانات يستخدم لتخزين سلسلة من الأحرف في لغة #C؟
أي نوع من البيانات يستخدم لتخزين سلسلة من الأحرف في لغة #C؟
ما هو نوع البيانات الذي يخزن قيمة منطقية (صحيح أو خطأ) في لغة #C؟
ما هو نوع البيانات الذي يخزن قيمة منطقية (صحيح أو خطأ) في لغة #C؟
أي نوع من البيانات يستخدم لتخزين الأرقام الصحيحة في لغة #C؟
أي نوع من البيانات يستخدم لتخزين الأرقام الصحيحة في لغة #C؟
ما هو نوع البيانات الذي يخزن الأرقام العشرية في لغة #C؟
ما هو نوع البيانات الذي يخزن الأرقام العشرية في لغة #C؟
ماذا يحدث إذا حاولت تخزين قيمة من نوع بيانات أكبر في متغير من نوع بيانات أصغر؟
ماذا يحدث إذا حاولت تخزين قيمة من نوع بيانات أكبر في متغير من نوع بيانات أصغر؟
ما هي القيمة الافتراضية للمتغير المنطقي (bool) إذا لم يتم تحديد قيمة له؟
ما هي القيمة الافتراضية للمتغير المنطقي (bool) إذا لم يتم تحديد قيمة له؟
ماذا تعني 'فترة حياة المتغير'؟
ماذا تعني 'فترة حياة المتغير'؟
ما هو 'نطاق المتغير'؟
ما هو 'نطاق المتغير'؟
كيف يمكنك تحويل البيانات الرقمية إلى بيانات نصية في لغة #C؟
كيف يمكنك تحويل البيانات الرقمية إلى بيانات نصية في لغة #C؟
ماذا يحدث عند محاولة استخدام متغير لم يتم الإعلان عنه؟
ماذا يحدث عند محاولة استخدام متغير لم يتم الإعلان عنه؟
ما هي المتغيرات المحلية؟
ما هي المتغيرات المحلية؟
ما هي المتغيرات العامة؟
ما هي المتغيرات العامة؟
عند تحويل قيمة من نوع بيانات عشري إلى نوع بيانات صحيح، ماذا يحدث للجزء العشري؟
عند تحويل قيمة من نوع بيانات عشري إلى نوع بيانات صحيح، ماذا يحدث للجزء العشري؟
أي العمليات التالية تستخدم لدمج سلسلتين نصيتين في لغة #C؟
أي العمليات التالية تستخدم لدمج سلسلتين نصيتين في لغة #C؟
لماذا نستخدم الثوابت في البرمجة؟
لماذا نستخدم الثوابت في البرمجة؟
ما هو الغرض من استخدام دالة Parse
؟
ما هو الغرض من استخدام دالة Parse
؟
أي من هذه الأنواع يمكن أن يخزن True أو False؟
أي من هذه الأنواع يمكن أن يخزن True أو False؟
ماذا يمثل المدى (Scope) الخاص بالمتغير؟
ماذا يمثل المدى (Scope) الخاص بالمتغير؟
ماذا يحدث إذا قمت بتعريف متغيرين بنفس الاسم داخل نفس النطاق؟
ماذا يحدث إذا قمت بتعريف متغيرين بنفس الاسم داخل نفس النطاق؟
أي العمليات التالية تستخدم لزيادة قيمة متغير بمقدار واحد؟
أي العمليات التالية تستخدم لزيادة قيمة متغير بمقدار واحد؟
ماذا تفعل الدالة ToString()
؟
ماذا تفعل الدالة ToString()
؟
أي من هذه الخيارات ليس نوع بيانات رقمي؟
أي من هذه الخيارات ليس نوع بيانات رقمي؟
ماذا يحدث إذا حاولت قسمة رقم على صفر؟
ماذا يحدث إذا حاولت قسمة رقم على صفر؟
ما هي القيمة الافتراضية للمتغير العددي (int) إذا لم يتم تحديد قيمة ابتدائية؟
ما هي القيمة الافتراضية للمتغير العددي (int) إذا لم يتم تحديد قيمة ابتدائية؟
أي من هذه الخيارات هو طريقة صحيحة لتعريف متغير ثابت من النوع int
باسم SIZE
وقيمته 10
؟
أي من هذه الخيارات هو طريقة صحيحة لتعريف متغير ثابت من النوع int
باسم SIZE
وقيمته 10
؟
في C#، ما هي الطريقة الصحيحة لتعريف متغير نصي باسم message
يحتوي على القيمة Hello World
؟
في C#، ما هي الطريقة الصحيحة لتعريف متغير نصي باسم message
يحتوي على القيمة Hello World
؟
ما هي نتيجة الكود التالي؟
int x = 5; x = x + 3; Console.WriteLine(x);
ما هي نتيجة الكود التالي؟
int x = 5; x = x + 3; Console.WriteLine(x);
أي نوع من البيانات هو الأنسب لتخزين عمر شخص؟
أي نوع من البيانات هو الأنسب لتخزين عمر شخص؟
ماذا يحدث إذا حاولت جمع متغير من نوع string
مع متغير من نوع int
باستخدام عامل الجمع +
؟
ماذا يحدث إذا حاولت جمع متغير من نوع string
مع متغير من نوع int
باستخدام عامل الجمع +
؟
ما هي الكلمة المفتاحية المستخدمة للإشارة إلى قيمة غير قابلة للتغيير بعد الإسناد الأولي؟
ما هي الكلمة المفتاحية المستخدمة للإشارة إلى قيمة غير قابلة للتغيير بعد الإسناد الأولي؟
عند تعريف متغير داخل حلقة for
، ما هو نطاقه؟
عند تعريف متغير داخل حلقة for
، ما هو نطاقه؟
أي من العمليات التالية تقوم بإرجاع باقي القسمة؟
أي من العمليات التالية تقوم بإرجاع باقي القسمة؟
في C#، أي مما يلي يمثل طريقة صحيحة لتعريف متغير من النوع العشري (decimal) وتعيين قيمة له؟
في C#، أي مما يلي يمثل طريقة صحيحة لتعريف متغير من النوع العشري (decimal) وتعيين قيمة له؟
Flashcards
المتغيرات (Variables)
المتغيرات (Variables)
حقول في الذاكرة لتخزين البيانات، قابلة للتغيير.
الثوابت (Constants)
الثوابت (Constants)
حقول في الذاكرة بقيم ثابتة لا تتغير.
قاعدة أساسية في تسمية المتغيرات
قاعدة أساسية في تسمية المتغيرات
يجب أن يبدأ بحرف هجائي.
حساسية حالة الأحرف (Case sensitive)
حساسية حالة الأحرف (Case sensitive)
Signup and view all the flashcards
الإعلان عن المتغير
الإعلان عن المتغير
Signup and view all the flashcards
int
int
Signup and view all the flashcards
float
float
Signup and view all the flashcards
string
string
Signup and view all the flashcards
bool
bool
Signup and view all the flashcards
تخصيص قيمة للمتغير (Assign)
تخصيص قيمة للمتغير (Assign)
Signup and view all the flashcards
قاعدة أساسية في المتغيرات من النوع String
قاعدة أساسية في المتغيرات من النوع String
Signup and view all the flashcards
طريقة استخدام المتغير
طريقة استخدام المتغير
Signup and view all the flashcards
كيفية عرض قيمة المتغير للمستخدم
كيفية عرض قيمة المتغير للمستخدم
Signup and view all the flashcards
كيفية يتعامل الكمبيوتر مع المتغيرات
كيفية يتعامل الكمبيوتر مع المتغيرات
Signup and view all the flashcards
المتغيرات المحلية (Local Variables)
المتغيرات المحلية (Local Variables)
Signup and view all the flashcards
متغيرات علي مستوي الملف أو النموذج
متغيرات علي مستوي الملف أو النموذج
Signup and view all the flashcards
المتغيرات العامة (Global Variables)
المتغيرات العامة (Global Variables)
Signup and view all the flashcards
تعريف الثوابت الخاصة
تعريف الثوابت الخاصة
Signup and view all the flashcards
التحويل بين أنواع البيانات
التحويل بين أنواع البيانات
Signup and view all the flashcards
إجراء Parse
إجراء Parse
Signup and view all the flashcards
الإجراء ToString
الإجراء ToString
Signup and view all the flashcards
Study Notes
Variables and Constants
- Variables are named storage locations in memory that can hold different values during program execution.
- Constants are named storage locations in memory that hold values that cannot be changed during program execution.
- Variables can store numerical, character, or other types of data.
- Variable contents can be altered at any time.
- Constants hold fixed data values that cannot changed during program execution.
- Examples of constants include a circle's area calculation where pi (π) is a constant value of 3.14.
Differentiating Variables and Constants
- Variables and constants are differentiated by their mutability, variables can change, constants cannot.
Variable Naming Rules
- Variable names must not start with a number.
- Variable names must begin with a letter.
- Variable names are case-sensitive.
- The variable name starts with a letter.
- Variable names cannot include spaces or special symbols.
- Variable names must not be reserved words in C#.
- It is possible to use the underscore character between the words
Data Types
- Data type declarations allocate memory space for the specified type of data.
- Common data types include integers, float, and strings.
- NET allocates memory based on the data type.
- There are signed integers to store both positive and negative numbers.
- There are unsigned integers which store only positive values.
Integer Data Types
- byte: Stores integers from 0 to 255 (1 byte).
- sbyte: Stores integers from -128 to 127 (1 byte).
- short: Stores integers from -32,768 to 32,767 (2 bytes).
- ushort: Stores integers from 0 to 65,535 (2 bytes).
- int: Stores integers from -2,147,483,648 to 2,147,483,647 (4 bytes).
- uint: Stores integers from 0 to 4,294,967,295 (4 bytes).
- long: Stores integers from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 (8 bytes).
- ulong: Stores integers from 0 to 18,446,744,073,709,551,615 (8 bytes).
Floating Point Data Types
- float: Stores floating-point numbers(4 bytes, 7 decimal digits).
- double: Stores floating-point numbers (8 bytes, 16 decimal digits).
- decimal: Stores floating-point numbers (16 bytes, 29 decimal digits).
Declaring Variables
- Variable declaration involves specifying the data type and name.
Datatype VariableName;
int streetNum;
- Multiple variables can be declared in one line.
int ax, bx, cx;
Strings and Chars Data Types
- string: Stores a sequence of text from multiple characters.
- char: Stores a single character (2 bytes).
string address;
Boolean Data Type
- bool: Stores either true or false values.
bool bx;
- The default value is false.
Working with Variables
- Assigning a value is called assignment.
Assigning Values to Variables
- Assign a value to a variable
int xx=90;
- Assign a value after declaring
int xx;
xx=90;
How Computers Handle Variables
- Assignment statements assign value.
- When you use the same name on both sides the computer computes the right side and overrides the left side.
Variable Scope
- Local Variables declared inside a method.
- Model Variables declared in the model, where they are kept until disposal.
- Global Variables are available to all Models.
Local Variables
- Declared inside a particular procedure or block of code.
- Use is restricted to the block in which declaration took place.
Model Variables
- Declared within the Form creation part.
- Visible to all actions within the form.
- Persist in memory until the form closes.
Global Variables
- Usable in every model.
- Declared inside a class.
Constants
- Constants values cannot be changed while the program is running.
- Two types: those defined within C#.NET and those defined by the programmer.
- To declare constants use const data type such as float.
Programmer Defined Constants
- These are defined within the project to be used as project specific constants.
Data Type Conversions
- C# provides type conversion between variables.
- A value placed between quotation marks "" will always be text.
- C#.Net treats text differently than numbers.
Parsing
- Use Parsed data when user inputs data is automatically stored as text (strings).
int xx;
xx= int.Parse(textBox1.Text) +int.Parse(textBox2.Text);
textBox3.Text = xx.ToString();
- Used when converting strings to numeric values example converting temperature from Celsius to Fahrenheit.
Converting Numbers to Strings
- Use .ToString();
Label1.Text = My_salary.ToString();
Numeric Data Conversions
- Type must be converted when converting between short and long, you can convert shorts into longs because it is going from smaller to larger bytes.
- Errors will occur when going from larger type like Long into Short.
- Operations for converting follow the Convert class.
Conversion Functions
- Convert.ToInt16
- Convert.ToInt32
- Convert.ToInt64
- Convert.ToDecimal
- Convert.ToSingle
- Convert.ToDouble
- Convert.ToByte
B1= Convert.ToDecimal(A1);
B2 = Convert.ToInt32(A2);
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.