WhatsApp-00963951432013 Admin
عدد المساهمات : 2429 نقاط : 302124 السٌّمعَة : 4 تاريخ التسجيل : 20/09/2008 العمر : 54 الموقع : www.aoua.123.st
| موضوع: Faculty of Computer Studies Course Code: M107 Course Title: Introduction to C# Programming Fall 2015- 2016-Tutor Marked Assignment Cut-Off Date: Total Marks:80 Contents Part I: Theoretical Questions [20 Marks] Part II: Output and Debuggi الأربعاء نوفمبر 11, 2015 3:07 am | |
|
Faculty of Computer Studies Course Code: M107 Course Title: Introduction to C# Programming Fall 2015- 2016-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: As per AOU rules and regulations, all students are required to submit their own TMA work and avoid plagiarism. The AOU has implemented sophisticated techniques for plagiarism detection. You must provide all references in case you use and quote another person's work in your TMA. You will be penalized for any act of plagiarism as per the AOU's rules and regulations. Declaration of No Plagiarism by Student (to be signed and submitted by student with TMA work): I hereby declare that this submitted TMA work is a result of my own efforts and I have not plagiarized any other person's work. I have provided all references of information that I have used and quoted in my TMA work. Name of Student: Signature: Date:
Part I: Theoretical Questions (4 marks each) [20 Marks]
1. Explain any four benefits of .NET Framework.
2. Differentiate between managed code and unmanaged code.
3. Describe the different type of parameters used in C# to pass value to a method? 4. Define Abstract Classes in C# with an example.
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 piece of code? [10 Marks] namespace ConsoleApplication1 { class MyProgram { static void Main(string[ ] args) { int number=1 while(true) { Console.WriteLine(number); number++; if(number <= 10) continue; else break; } Console.WriteLine(“Series is broken at number:”+number); } } }
2. a. Rewrite the following if-else statement using the ternary operator: [4 Marks]
if (points >= 5000) Console.WriteLine("You won a Television"); else Console.WriteLine("You won a Laptop");
b. What is the output of the following piece of code? [6 Marks]
namespace ConsoleApplication2 { class MyProgram { public static int GetSum(params int[] numbers) { int sum=0 foreach (int num in numbers) sum+=num; return sum; } public static void Main(string[ ] args) { Console.WriteLine(“The Sum is: “) Console.WriteLine(GetSum(1,2,3,4,5,6,7,8,9)); Console.WriteLine(GetSum(2,4,6,8)); } } }
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 program to create two multidimensional arrays of same size. Accept value from user and store them in first array. Now copy all the elements of first array into second array and print second array [15 Marks] 2. Write a C# application that asks the user to input the required data to implement the four methods below: (Use Method Overloading to write the methods) a. Method Area that take as input an int value ‘side’, calculates the area of a square, and displays it. b. Method Area that take as input an int value ‘L’ and an int value ‘B’, calculates the area of a rectangle, and displays it. c. Method Area that takes as input a double value ‘R’, calculates the area of a circle, and displays it. d. Method Area that take as input a double value ‘B’, and a double value ‘H’, calculates the area of a triangle, and displays it.
[15 Marks] 3. Write a C# application that asks the user to input a month and prints the number of days in the month. Use Switch statement. [10 Marks]
| |
|