-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
323 lines (228 loc) · 10.1 KB
/
Program.cs
File metadata and controls
323 lines (228 loc) · 10.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
using System;
using System.ComponentModel;
using System.Security.Cryptography.X509Certificates;
namespace C__Fundmelts_With_Almhady
{
internal class Program
{
static void Main(string[] args)
{
// The Console
/*
Console.Title = "C# Exercis";
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine("Hello");
Console.BackgroundColor = ConsoleColor.Red;
Console.WriteLine("World");
Console.ForegroundColor = ConsoleColor.White;
Console.BackgroundColor = ConsoleColor.Black;
Console.ReadKey();*/
// Declertion The Vairale
// The First ===> string
// string printanything = "Hello wrold";
/*string printanything;
printanything = "Hello wrold";
// string printanything = default;
Console.WriteLine(printanything);
Console.WriteLine(printanything);
Console.WriteLine(printanything);
Console.WriteLine(printanything);
*/
//==================================================================
/*
// The Second ===> Boolean
bool IsAlive = false;
Console.Write("The IsAvlive = ");
Console.WriteLine(IsAlive);
IsAlive = true;
Console.Write("The IsAvlive = ");
Console.WriteLine(IsAlive);
IsAlive = default;
Console.Write("The IsAvlive = ");
Console.WriteLine(IsAlive);
IsAlive = default;
Console.Write("The IsAvlive = ");
Console.WriteLine(IsAlive);
// The Opreator ^ , && , || , !with boolean
bool boolean1 = true, boolean2 = false;
// The First && , &
// the &&===> true&&true= true, false && false =false , false && true = false , true && fales=false
// the &===> true & true = true, false & false = false , false & true = false , true &fales = false
/*bool Result1 = boolean1 & boolean2;
bool Result2 = boolean1 && boolean2;
Console.Write("The Result1 = ");
Console.WriteLine(Result1);
Console.Write("The Result1 = ");
Console.WriteLine(Result2);*/
// The Second || , |
// the ||===> true || true = true, false || false = false , false || true = true, true || fales = true
// the ||===> true | true = true, false | false = false , false | true = true, true | fales = true
/* bool Result1 = boolean1 | boolean2;
bool Result2 = boolean1 || boolean2;
Console.Write("The Result1 = ");
Console.WriteLine(Result1);
Console.Write("The Result1 = ");
Console.WriteLine(Result2);*/
// The Thirde !
/* bool Result1 = !boolean1 ;
bool Result2 = !boolean2;
Console.Write("The Result1 = ");
Console.WriteLine(Result1);
Console.Write("The Result1 = ");
Console.WriteLine(Result2);*/
// The Fourth ^
// the ^ ===> true ^ true = true, false ^ false = false , false ^ true = true, true ^ fales = true
/* bool Result1 = boolean1 ^ boolean2;
bool Result2 = boolean1 ^ boolean2;
Console.Write("The Result1 = ");
Console.WriteLine(Result1);
Console.Write("The Result1 = ");
Console.WriteLine(Result2); */
// ==============================================================
// The Third Console.Read
// SCVAlue
/* int c = Console.Read();
int c1= Console.Read();
int c2= Console.Read();
int c3= Console.Read();
Console.WriteLine(c);
Console.WriteLine(c1);
Console.WriteLine(c2);
Console.WriteLine(c3);*/
// To The Enter Any Thing And Print it
/*
string c = Console.ReadLine();
string c1 = Console.ReadLine();
string c2 = Console.ReadLine();
string c3 = Console.ReadLine();
Console.WriteLine(c);
Console.WriteLine(c1);
Console.WriteLine(c2);
Console.WriteLine(c3);*/
// Progrm To Print The SCk For The Letters Form A To Z And The Number Form 1 To 10
// int[,] num = new int[9,9];
// int [,] Letter = new int [26,26];
/* Console.WriteLine("Enter The Numbers From 1 to 10:");
for(int i=0;i<num.Length;i++)
{
num[i,i] = Console.Read() ;
Console.WriteLine(num[i,i]);
}*/
/* Console.WriteLine("Enter The Numbers From 1 to 10:");
for (int i=0;i<Letter.Length;i++)
{
Letter[i,i] = Console.Read() ;
Console.WriteLine(Letter[i,i]);
}*/
// ============================================
// the fiveth Char
/* char letter = 'A';
char b = '2';
// Console.WriteLine(letter);
// Console.WriteLine((int)letter);
bool c = char.IsDigit(letter);
// Console.WriteLine(c);
// c = char.IsDigit('5');
// Console.WriteLine(c);
c = char.IsLetter(letter);
Console.WriteLine(c);
bool s = char.IsLetter(b);
Console.WriteLine(s);
// c = char.IsLetter(x);
//Console.WriteLine(c);*/
//1- char.IsLetter
/* char a = 'a';
bool x = char.IsLetter(a);
Console.WriteLine(x);*/
//2-char.IsDigit
/*char a = '1';
bool x = char.IsDigit(a);
Console.WriteLine(x);*/
// 3 - char.IsWhiteSpace
/* char space = ' ';
bool ishiteSpace = char.IsWhiteSpace(space);
Console.WriteLine(ishiteSpace);*/
// 4 - char.IsUpper;
/* char upperChar = 'A';
bool isUpper = char.IsUpper(upperChar);
Console.WriteLine(isUpper);*/
// 5- char.IsLower;
/* char lowerChar = 'a';
bool islower = char.IsLower(lowerChar);
Console.WriteLine(islower);*/
// 6- char.ToUpper;
/* char lowerChar = 'a';
char upper = char.ToUpper(lowerChar);
Console.WriteLine(upper); */
// 7- char.ToLower;
/* char tolowerChar = 'A';
char lower= char.ToLower(tolowerChar);
Console.WriteLine(lower); */
// 8- char.IsPunctuation;
/* char punctuationChar = ',';
bool ispunctuation= char.IsPunctuation(punctuationChar);
Console.WriteLine(ispunctuation);*/
// 9- char.IsControl;
/* char iscontrol = '\n';
bool Control = char.IsControl(iscontrol);
Console.WriteLine(Control);*/
// 10- char.IsSymbol;
/* char issymbol = '$';
bool Symbol= char.IsSymbol(issymbol);
Console.WriteLine(Symbol);*/
// 11- char.MinValue;
// Console.WriteLine(Char.MinValue);
// 12- char.MaxValue;
// Console.WriteLine(char.MaxValue);
// 13- Char.IsSurrogate
/* char issurrogate = '\udc00';
bool isSurrogate = Char.IsSurrogate(issurrogate);
Console.WriteLine(isSurrogate);*/
// The Function For char
// ==========================
/* 1 - char.IsLetter ====> if The The Value Is Letter
2 - char.IsDigit ====> if The The Value Is number
3 - char.IsWhiteSpace ====> if The The Value Is space like ' '
4 - char.IsUpper; ====> if the letter small true
5 - char.IsLower; ====> if the letter big true
6 - char.ToUpper; ====> if the letter small the letter become Big
7 - char.ToLower; ====> if the letter big the letter become small
8 - char.IsPunctuation; ====> if value like ? , . ; true
9 - char.IsControl; ====> if value like Enter
10 - char.IsSymbol; ====> if value like @ # $ & * true
11 - char.MinValue; ====> The a small value That char take it
12 - char.MaxValue; ====> The a big value That char take it
13 - Char.IsSurrogate
======================================*/
//=======================================================
// the sixth The string
/*
*
* The Function for String
1- Length
2- ToUpper
3- ToLower
4- StartsWit
5- EndsWith
6- Contains
7- IndexOf
8- Replace
*/
//string name = "";
//Console.Write("Enter Your Name : ");
//name = Console.ReadLine();
//Console.WriteLine($"Welcome {name} \n To Oure Companys' Websit");
//Console.WriteLine($"The Length = {name.Length}");
//Console.WriteLine($"Upper Case: {name.ToUpper()} ");
//Console.WriteLine($"Upper Case: {name.ToLower()} ");
//bool startswith = name.StartsWith("R");
//Console.WriteLine(startswith);
//bool endswith = name.EndsWith("i");
//Console.WriteLine(endswith);
//bool contain = name.Contains("NU",StringComparison.OrdinalIgnoreCase);
//Console.WriteLine(contain);
//Console.WriteLine(name.IndexOf("NU",StringComparison.OrdinalIgnoreCase));
// Console.WriteLine(name.Replace("AlNuaimi","Ayed",StringComparison.OrdinalIgnoreCase));
}
}
}