تم الحل ✓
categoryبرمجة وتطوير البرمجيات
schoolبكالوريوس
event_available2026-07-15
السؤال
Transcribed Image Text:
Part III- Problem Solving Questions
[40 Marks]
Note: Provide a copy of the code and screen shot for the output in the solutions'. Explain the working
of each program in your own language.
1. Using loops, write a C# program to print the following pattern.
1
21
321
4321
54321
654321
7654321
87654321
987654321
10987654321
[10 Marks]
2. Write a C# application that asks the user to input the required data to implement the two
methods below:
(Use Method Overloading to write the methods)
a. Method Perimeter that takes as input, a double value (length), calculates the
perimeter of a square, and displays it. [Perimeter = 4 = length]
b. Method Perimeter that takes as input two double values (length) and (width),
calculates the perimeter of a rectangle, and displays it. [Perimeter = 2*
(length + width)]
Sample I/O
Enter the length of the square:
3.2
Enter the length of the rectangle:
5.1
Enter the width of the rectangle:
2.3
The perimeter of the square is 12.8
The perimeter of the rectangle is 14.8
[15 Marks]
3. Write a C# application that asks the user to count the number of even numbers and odd
numbers in an array. Input an array of 10 elements. Count the number of even numbers
and the odd numbers in the input array and display the count.
Sample I/O
Enter the array elements:
[15 Marks]
The number of even numbers:4
The number of odd numbers: 6
End of the TMA**********
check_circle الجواب — حل مفصل خطوة بخطوة
hourglass_top
🔒
الحل الكامل متاح للمشتركين
اشترك في أرشيف الأسئلة لعرض هذا الحل وآلاف الحلول المفصلة خطوة بخطوة من معلمين معتمدين.