-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
385 lines (307 loc) · 8.43 KB
/
Program.cs
File metadata and controls
385 lines (307 loc) · 8.43 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
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
// See https://aka.ms/new-console-template for more information
// Console.WriteLine("Hello, World!");
// ASSIGNMENT OF CHAPTER 4;
// NUMBER ONE;
// int a = 2;
// int h = 3;
// int d = 4;
// int sum = a + h + d;
// Console.WriteLine(sum);
// NUMBER TWO;
// Console.WriteLine("Enter the radius of a circle");
// int radius = int.Parse(Console.ReadLine());
// double perimeter = 2 * 3.142 * radius;
// double area = 3.142 * radius * radius;
// Console.WriteLine("The perimeter of a circle is " + perimeter);
// Console.WriteLine("The area of a circle is " + area);
// NUMBER 3;
// Console.WriteLine("Enter the company address");
// string address = Console.ReadLine();
// Console.WriteLine("Enter your phone number");
// long num = long.Parse(Console.ReadLine());
// Console.WriteLine("Enter your fax number");
// string faxNum = Console.ReadLine();
// Console.WriteLine("Enter the company website");
// string website = Console.ReadLine();
// Console.WriteLine("Enter the manager name");
// string name = Console.ReadLine();
// Console.WriteLine("Enter the manager surname");
// string surname = Console.ReadLine();
// Console.WriteLine("Enter the manager phone number");
// long num2 = long.Parse(Console.ReadLine());
// Console.WriteLine("the company address is" + address + );
// NUMBER 6;
// Console.WriteLine("Enter the first number");
// double num = double.Parse(Console.ReadLine());
// Console.WriteLine("Enter another number");
// double num2 = double.Parse(Console.ReadLine());
// double x = Math.Max( num,num2);
// Console.WriteLine("the biggest number is "+ x);
// ASSIGNMENT ON IF STATEMENT i.e CHAPTER FIVE;
// QUESTION 1;
int a = 10;
int b = 5;
int c = 0;
if(a > b)
{
c=a;
a=b;
b=c;
}
// QUESTION 7;
// int a = 5;
// int b= 7;
// int c = 9;
// int d = 11;
// int f = 15;
// if(a > b && a > c && a > d && a > f)
// {
// Console.WriteLine(a + " is the greatest number");
// }
// else if(b > c && b > d && b > f && b > a)
// {
// Console.WriteLine(b + " is the greatest number");
// }
// else if(c > d && c > f && c > a && c > b)
// {
// Console.WriteLine(c + " is the greatest number");
// }
// else if(d > f && d > a && d > b && d > c)
// {
// Console.WriteLine(d + " is the greatest number");
// }
// else if(f >a && f > b && f > c && f > d)
// {
// Console.WriteLine(f + " is the greatest number");
// }
// else
// {
// Console.WriteLine("Invalid numbre");
// }
// QUESTION 5;
// Console.WriteLine("Enter a number between 0 and 9");
// int num = int.Parse(Console.ReadLine());
// switch(num)
// {
// case 1:
// Console.WriteLine("one");
// break;
// case 2:
// Console.WriteLine("two");
// break;
// case 3:
// Console.WriteLine("three");
// break;
// case 4:
// Console.WriteLine("four");
// break;
// case 5:
// Console.WriteLine("five");
// break;
// case 6:
// Console.WriteLine("six");
// break;
// case 7:
// Console.WriteLine("seven");
// break;
// case 8:
// Console.WriteLine("eight");
// break;
// case 9:
// Console.WriteLine("nine");
// break;
// default:
// Console.WriteLine("Invalid number");
// break;
// }
// int a = 5;
// NUMBER 3;
// int num = 0;
// int max = 0;
// if(num < 3)
// {
// Console.WriteLine("Enter the first number");
// int num = int.Parse(Console.ReadLine());
// Console.WriteLine("Enter the second number");
// int num2 = int.Parse(Console.REadLine());
// Console.WriteLine("Enter the third number");
// int num3 = int.Parse(Console.ReadLine());
// if(num > num2 && num > num3)
// {
// max = number;
// }
// if(num < num2 && num2 < num3)
// {
// max = num2;
// }
// if(num < num2 && num2 < num3)
// {
// max = num3;
// }
// Console.WriteLine(max);
// QUESTION 8;
// Console.WriteLine("Enter first varaible");
// int num = int.Parse(Console.ReadLine());
// switch(num)
// {
// case 1:
// Console.WriteLine("Enter integer number");
// int x = int.Parse(Console.ReadLine());
// x++;
// Console.WriteLine(x);
// break;
// case 2:
// Console.WriteLine("Enter double figure");
// double r = double.Parse(Console.ReadLine());
// r++;
// Console.WriteLine(r);
// break;
// case 3:
// Console.WriteLine("Enter a string format");
// string y = Console.ReadLine();
// y += "*";
// Console.WriteLine(y);
// break;
// default:
// Console.WriteLine("Invalid term");
// break;
// }
// NUMBER10;
// Console.WriteLine("Enter any nunber between 0 and 9");
// int kum = int.Parse(Console.ReadLine());
// switch(kum)
// {
// case 1:
// case 2:
// case 3:
// Console.WriteLine("the bonus score " + (kum * 10));
// break;
// case4:
// case 5:
// case 6:
// Console.WriteLine("the bonus score " + (kum * 100));
// break;
// case 7:
// case 8:
// case 9:
// Console.WriteLine("the bonus score " + (kum * 1000));
// break;
// default:
// Console.WriteLine("Invalid number");
// break;
// }
// ASSIGNMENT 2;
// QUESTION 1;
// Console.WriteLine("Enter your number");
// int num = int.Parse(Console.ReadLine());
// if(num % 2 == 0)
// {
// Console.WriteLine("Number is even");
// }
// else
// {
// Console.WriteLine("Number is odd");
// }
// QUESTION 2;
// Console.WriteLine("Enter num");
// int num = Convert.ToInt32(Console.ReadLine());
// if (num % 5 == 0 && num % 7 == 0)
// {
// Console.WriteLine(true);
// }
// else
// {
// Console.WriteLine(false);
// }
// QUESTION 7;
// Console.WriteLine("Enter a number");
// int num = int.Parse(Console.ReadLine());
// Console.WriteLine( num * 0.17d);
// QUESTION 5;
// Console.WriteLine("Enter a value");
// double aValue = double.Parse(Console.ReadLine());
// Console.WriteLine("Enter b value");
// double bValue = double.Parse(Console.ReadLine());
// Console.WriteLine("Enter h value");
// double hValue = double.Parse(Console.ReadLine());
// double surface = (aValue + bValue) * hValue / 2;
// Console.WriteLine("the surface is " + surface);
// QUESTION 8;
// Console.WriteLine("Enter the value of x");
// int x = int.Parse(Console.ReadLine());
// Console.WriteLine("Enter the value of y");
// int y = int.Parse(Console.ReadLine());
// bool isEqual = (x*x) + (y*y) <= 5*5;
// Console.WriteLine(isEqual);
// QUESTION 6;
// Console.WriteLine("Enter the side of the rectangle");
// double side = double.Parse(Console.ReadLine());
// Console.WriteLine("Enter the height of the rectangle");
// double height = double.Parse(Console.ReadLine());
// double perimeter = 2 * (side + height);
// double area = side * height;
// Console.WriteLine("the perimeter is " + perimeter);
// Console.WriteLine("the area is " + area);
// QUESTION 3;
// int num = 6789;
// Console.WriteLine("Enter your number");
// int digit = int.Parse(Console.ReadLine());
// int div = num / 100;
// int GetlastNum = div % 10;
// if (GetlastNum == 7)
// {
// Console.WriteLine("true");
// }
// else
// {
// Console.WriteLine("false");
// }
// QUESTION 4;
// Console.WriteLine("Enter a number");
// int num = int.Parse(Console.ReadLine());
// bool bit3 = (num & 8) != 0;
// Console.WriteLine(bit3);
// CHAPTER SEVEN;
// NUMBER ONE;
// int[] number = new int[20];
// for(int i = 0; i < number.Length; i++)
// {
// number[i] = i * 5;
// Console.Write(number[i] + " ");
// }
// NUMBER TWO;
// Console.WriteLine("Enter the first number");
// int f = int.Parse(Console.ReadLine());
// Console.WriteLine("Enter the second number");
// int k = int.Parse(Console.ReadLine());
// Console.WriteLine("Enter length of an array");
// int length = int.Parse(Console.ReadLine());
// int[] num =new int[length];
// for(int i = 0; i < num.Length; i++)
// {
// Console.WriteLine("Enter a given number");
// int p = int.Parse(Console.ReadLine());
// num[i] = p;
// }
// Console.WriteLine("Enter another length");
// int length2 = int.Parse(Console.ReadLine());
// int[] t = new int[length2];
// for(int r = 0; r < t.Length; r++)
// {
// Console.WriteLine("Enter another number");
// int y = int.Parse(Console.ReadLine());
// t[r] = y;
// }
// if(length == length2)
// {
// for(int i= 0; i < num.Length; i++)
// if(t[i] != num[i])
// {
// Console.WriteLine("They are equal");
// }
// else
// {
// Console.WriteLine("they are not equal");
// }
// }
// NUMBER 3;