تم الحل ✓
categoryهندسة الحاسبات
schoolبكالوريوس
event_available2026-07-15
السؤال
Transcribed Image Text:
Write a program by C# programming language that has the followings:
static void Main(strical] args)
tex
// Declace two inteasc variables based as "com" and "col"
// Get the values of the "cox" and "col" from the user.
II
// if the value, of the, "com" is less than. 1, catch part, will be cua
// if the value of the "cal" is less than 1, catch, pact, will be cun
// Declare the two dimensional integer accax "atcix"
// which has the size (coxx col)
// Create the Streamciter, object oated, as "ax"
// "x" will cefecance "ayFile.txt"
// Call "Createlandonbuxbers" sethod
11
to assim candon, values, to each element of "satcix" acc
// Call WiteTalile sethod.
// Create the Stceanteadec object oaned as "se":
// ac will cead all content of "ayfile.txt"
and the content will be displayed at Console window
catch (Exception)
#1
white, statis wold CceateRaodoint(0))
で
// In)
BULLE Static Wale weiteOMELSE. Ltd.)
C
wite the cistests of the way in the store
to the tile filetat
Call AvALL 40
in on the tile.am
Odak
public static vaid. CreateRandomNumbers(lat.))
// int }
public static vald, WriteTofile(Streamiciter, w, lat[+] )
// write the elements of the "w" accay in the eatrix format
to the file "myFile.txt".
H
ff call the "AxecageOfAllElements" sethod, and
wite the cetucned, value, after that text
22
The axecage of all elements of the eatris in the file "ayFile.txt"
NUMBERS IN EACH ROW: in the File myFile.txt
Call the itembecoachton method
// Put the beader "LIST OF ODD
Put the beader. "LIST OF EVEN NUMBERS IN EACH COLUMN In the file "eyfile.txt
// Call the "HitexecumbeattachColumn
thod
public static double AverageOfALILlements(intl.])
public static wold WelteddNumberaQflachtowl Steamciter w. dat.1)
// write to add suck in sacs cox of the "" accay
// to the "myFile.txt as in the Gutaux exatola
pelic static void writetxeobbersoftachColumn(Streamciter. w. Lat.
write A Rec in cars column of the
it to "myFile.tit as in statul Ex
Oda
OUTPUT EXAMPLES:
1. example
2. example
口 X
CAWindowssystem32\cmde
Enter the row number: 5
5
Enter the column number: 10
C\Windows\system32\cmd.exe
Enter the row number:
Row olumn number can not be less than 1
Press any key to continue
0
X
Now or column number can not be less than 1
Press my key to continue
3. example
Console window
Windowstaystem32\
Fater the row number: 5
Enter the column number: 10
Content of "myFile.txt"
MATRIX:
MN
40
25 75 30
10 31
41
96
15
54
76 40 30
23
97
10
29
99
91 85
62 33 63
15 29
ST 27
42 18
21
29
48
10
69
BROM
11
33
18
28
77
42
21
45
91
36
90
12 33 41
99
LIST OF 000 MBERS IN LACE IN
The average of all elements of the matrix: 55.02
1ST OF ODD PRERS TN FACH ROW:
odd numbers in 1. row: 23 73 31 41 13 11
od nabers in 2. row: 30 21 97 29 77
odd numbers in 3. row: 989 97 83 85 53 63 45 91
Old numbers in 4. row: 95 29 29 80 81
06d numbers in 5. row: 31 25 21 5 41 99
LIST OF EVEN MPHERS IN EACH COLLE
Cven numbers in 1. culum: 54 50
Even numbers in 2. column: 76
Even numbers in 3. culumn: 56 40 42
Fven ushers in 4. column: 66 18
Even numbers in 5.
Fun unhers in 6.
column: 90
column: 62 48 60
Even numbers in 7. column: 90 10 10 72
Even mumbers in 8. column
even numbers in 9. column: 98
Cven numbers in 10. culum: 42 36
Press any key to continue
LIST OF EVEN PERS IN EACH COLUM
Eves abers in 3 colum 642
IMPORTANT NOTE: AFTER DUE DATE, DO NOT
OFFER TO UPLOAD OR EMAI YOU
==
check_circle الجواب — حل مفصل خطوة بخطوة
hourglass_top
🔒
الحل الكامل متاح للمشتركين
اشترك في أرشيف الأسئلة لعرض هذا الحل وآلاف الحلول المفصلة خطوة بخطوة من معلمين معتمدين.