Sunteți pe pagina 1din 10

Course Code: M107

Course Title: Introduction to C# Programming


Spring 2017- 2018 -Tutor Marked Assignment

Cut-Off Date: Total Marks:


80
Contents
Part I: Theoretical Questions [20
Marks]
Part II: Output and Debugging Questions [20
Marks]
Part III: Problem Solving Questions [40
Marks]
Plagiarism Warning:
Part I: Theoretical Questions (4 marks each) [20
Marks]
1. Describe the building blocks of .NET platform.

2. Briefly explain the unary operators in C#.

3. Differentiate between if-else statement and switch statement.

4. Explain briefly the declaration, initialization and creation of two-dimensional


arrays.

5. Explain Runtime Polymorphism with an example.

Part II: Output and Debugging Questions (10 marks each) [20
Marks]

Note: Provide a copy of the code and screen shot for the output in the solutions’

1. What is the output of the following program?


[10 Marks]

namespace ConsoleApp20
{
class Program
{
static void Main(string[] args)
{
int p;
int[] A = { 14, 85, 62, 19, 78, 42, 12, 23, 69, 60 };
for (p = 0; p < 10; ++p)
{
if (A[p] > 50)
Console.WriteLine(A[p]);

}
Console.ReadLine();

2. What is the output of the following program?


[6 Marks]

namespace ConsoleApp20
{
class Program
{
static void change(int p, ref int q)
{
p = p * 10;
q = q * 100;
}

static void Main(string[] args)


{
int M = 23;
int N = 43;
change(M, ref N);
Console.WriteLine("M =" + M);
Console.WriteLine("N =" + N);
Console.ReadLine();
}

3. Identify the errors in the following C# program. Write the correct


program.
[4 marks]

class Program
{

static void Main(string[] args)


{
Console.WriteLine("The first 10 natural number are:")

for ( i = 1; i <= 10, i++)


{
Console.Write("{0} ", );
}

Console.ReadLine();
}

Part III- Problem Solving Questions [40


Marks]

Note: Provide a copy of the code and screen shot for the output in the solutions’

1. Write a C# Sharp program to read a number input by the user and find

(a) the sum of digits of the number and

(b) display the reversed number. [15 marks]

Sample I/O
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 Area that takes as input, double values ‘b’ (base) and ‘h’
(height), calculates the area of a parallelogram, and displays it.
[Area = ]
b. Method Area that takes as input, double values ‘b1’ (base 1), ‘b2’
(base 2) and ‘h’ (height), calculates the area of a trapezoid, and

displays it. [Area = ]

[15
Marks]

Sample I/O

2. Using loops, write a C# program to print the following pattern.


[10 Marks]

M107 00966597837185 TMA ‫ حل واجبات‬M107 ‫المهندس أحمد @ الجامعة العربية المفتوحة‬


~ ‫ حل واجب‬M107 ** 00966597837185 ~‫المفتوحة‬,‫العربية‬,‫الجامعة‬,‫واجبات‬,‫المهندس أحمد~ حلول‬
#‫ حل_واجب‬M107 00966597837185 ‫ حل واجبات‬M107 ‫الجامعة العربية المفتوحة‬
M107 ‫ حل واجب‬00966597837185:‫ المهندس أحمد‬M107 , ‫واجبات الجامعة العربية المفتوحة‬
M107 TMA Answers ENG:Ahmed ‫ حل واجب‬M107 00966597837185
‫ واجب‬, ‫ حل‬, M107 00966597837185 ~ ‫حلول واجبات الجامعـة العربية المفتوحة‬
‫المهندس احمد لحلول الواجبات الجامعة العربية المفتوحة > ‪ M107 ? 00966597837185‬حل واجب‬
‫خل واجبات الجامعة ‪ M107‬حل واجب المهندس احمد ‪M107 00966597837185‬‬
‫‪ M107‬مهندس أحمد ‪ ,,,,‬حلول واجبات ‪ M107 << 00966597837185‬حل واجبات المتياز‬
‫حلول واجبات ‪ M107‬المفتوحة‪ ,‬حل واجب‪ M107,‬حل‪,‬واجبات‪,‬الجامعة‪,‬العربية‪00966597837185 ,‬‬
‫الجامعة العربية المفتوحة‬
‫‪ M107‬حلول واجبات الجامعة العربية المفتوحة ‪ M107 Answers 00966597837185‬حل واجب‬
‫المهندس )‪ (00966597837185‬أحمد ‪ ,,‬حلول واجبات الجامعة العربية المفتوحة ‪ M107‬حل واجب‬

‫حل واجبات جروب المتياز بقيادة المهندس أحمد ‪ 00966597837185‬تنبيه ‪ ,,‬رقمي الوحيد لعدم التعرض‬
‫للحتيال‬

‫حل واجبات الجامعة العربية المفتوحة ‪ << 00966597837185 - 0597837185‬مهندس أحمد‬

‫حلول واجبات الجامعة العربية المفتوحة >>> المهندس أحمد ‪00966597837185‬‬


‫حل واجبات الجامعة العربية المفتوحة لجميع المواد والتخصصات‪,‬مع نخبة من أفضل الساتذه والمهندسين‬
‫المتخصصين‬
‫‪ A_Al_SHORA@hotmail.com‬اميل المهندس أحمد‬

‫حل واجبات الجامعة العربية المفتوحة ‪ ,, 00966597837185‬حلو ل واجبات الجامعة العربية المفتوحة ‪,,‬‬
‫حلول الواجبات ‪ M107‬حل الواجب ‪ M107‬حلول واجبات ‪ M107‬جروب المتياز المهندس أحمد حل واجب‬
‫بدون تشابه حل واجبات الجامعة العربية المفتوحة ‪ ,, 00966597837185‬حلو ل واجبات ‪M107 TMA‬‬
‫حل ‪ M107‬حلول واجبات ‪ M107‬الجامعة العربية المفتوحة ‪ ,,‬جروب المتياز المهندس أحمد حل واجب‬
‫بدون تشابه ‪ M107 TMA‬حلول الواجبات ‪ M107‬الواجب‬

S-ar putea să vă placă și