Page 1 of 1

Part I: Theoretical Questions (4 marks each) [20 Marks] 1. Define .NET Framework class library. List any three namespace

Posted: Sat Jul 09, 2022 11:49 am
by answerhappygod
Part I Theoretical Questions 4 Marks Each 20 Marks 1 Define Net Framework Class Library List Any Three Namespace 1
Part I Theoretical Questions 4 Marks Each 20 Marks 1 Define Net Framework Class Library List Any Three Namespace 1 (35.79 KiB) Viewed 31 times
Part I Theoretical Questions 4 Marks Each 20 Marks 1 Define Net Framework Class Library List Any Three Namespace 2
Part I Theoretical Questions 4 Marks Each 20 Marks 1 Define Net Framework Class Library List Any Three Namespace 2 (26.51 KiB) Viewed 31 times
Part I Theoretical Questions 4 Marks Each 20 Marks 1 Define Net Framework Class Library List Any Three Namespace 3
Part I Theoretical Questions 4 Marks Each 20 Marks 1 Define Net Framework Class Library List Any Three Namespace 3 (31.34 KiB) Viewed 31 times
Part I Theoretical Questions 4 Marks Each 20 Marks 1 Define Net Framework Class Library List Any Three Namespace 4
Part I Theoretical Questions 4 Marks Each 20 Marks 1 Define Net Framework Class Library List Any Three Namespace 4 (39.92 KiB) Viewed 31 times
Part I Theoretical Questions 4 Marks Each 20 Marks 1 Define Net Framework Class Library List Any Three Namespace 5
Part I Theoretical Questions 4 Marks Each 20 Marks 1 Define Net Framework Class Library List Any Three Namespace 5 (15.92 KiB) Viewed 31 times
Part I: Theoretical Questions (4 marks each) [20 Marks] 1. Define .NET Framework class library. List any three namespaces defined in .NET Framework class library with description. 2. Which of the following are invalid variable names? If a variable is invalid, state the why is it so? reason, a) Aou b) GCC Country c) lab d) int 3. Describe abstract classes in C# with an example. Explain the example in your own words. 4. Explain any two ways of passing parameters to a method in C#. Give an example. Explain the example in your own words. 5. How multiple inheritance is implemented in C#? Demonstrate with the help of an example. Part II: Output and Debugging Questions (10 marks each) 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? Explain. using System; public class Program { public static void Main(string[] args) { int i, j; int [] A = new int [5,5]; for (i = 0; i < 5; ++i) { for (j = 0; j < 5; ++j) { A[i,j] = 1*i; } [20 Marks] [10 Marks]
{ } } using System; public class Program { for (i = 0; i < 4; ++i) { } } else { } for (j = 0; j < 5; ++j) { } if (i < 5) { 2. Consider the following program. What will be the output (a) if the value of a is 1.9 and (b) if the value of a is 3.2? Explain your answer. [6 marks] A[j,i] = A[i, j]; } else break; Console.Write(A[i, j] + " "); Console.WriteLine(); Console.ReadLine(); static void check(double gpa) if (gpa < 2) { throw new Arithmetic Exception ("You cannot graduate"); Console.WriteLine("You are graduated"); public static void Main() { double a; Console.WriteLine("Enter your "); a = double.Parse(Console.ReadLine());
} 3. } check(a); Consider the program below. Which statements should be added in the Main function so as to produce the following output? [4 Marks] Department Name: Information Technology Hob: Dr.Nabel Section Name: Multimedia using System; { } public class Department public string DeptName; private string HoD; public void GetDepartmentInfo(string D) { HOD = D; Console.WriteLine("Department Name: {0}", DeptName); Console.WriteLine("HOD: {0}", HOD); } public class Section : Department public string SecName; public void GetSecName() { Console.WriteLine("Section Name: {0}", SecName); } } public class Program { public static void Main() { Section Multimedia = new Section(); // write the codes here // Write the codes here // Write the codes here // Write the codes here
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 1/0 Enter the length of the square: 3.2 100 TEL 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 1635 [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. [15 Marks] Sample I/O Enter the array elements: The number of even numbers:4 The number of odd numbers: 6 ********** End of the TMA"