C# (May – 2018) [IDOL - Old Course | Question Paper]


C# (May - 2018) [IDOL - Old Course | Question Paper]
C# (May - 2018) [IDOL - Old Course | Question Paper]

DOWNLOAD @
PDF
Text
SlideShare
GitHub
G-Drive
Torrent
Pinterest
☛ YouTube

Time: 3 Hours
Total Marks: 100

NOTES:
(1) Question No. 1 is Compulsory.
(2) Attempt any four from Question Nos. 2 to 7.
(3) Make suitable assumptions wherever necessary and state the assumptions made.
(4) Answers to the same question must be written together.
(5) Numbers to the right indicate marks.
(6) Draw neat labeled diagrams wherever necessary.

Q.1. Attempt the following Questions: (20 Marks)
(A) What is arithmetic expression? Explain evaluation of expressions. (5 Marks)
(B) Write short note on Common Language Runtime. (5 Marks)
(C) Briefly explain reference types and value types. Give examples for both. (5 Marks)
(D) What is a constructor? Explain about static constructor. (5 Marks)

Q.2. Attempt the following Questions: (20 Marks)
(A) Write a program to print the following pattern using nested for loop: (8 Marks)
   1
   2 3
   3 4 5
   4 5 6 7
   5 6 7 8 9
(B) Give a brief account on: (6 Marks)
      (i) if…else statement
      (ii) the ?: operator
(C) What do you mean by type casting? Explain Pow and Sqrt methods of Math class with proper syntax and example. (6 Marks)

Q.3. Attempt the following Questions: (20 Marks)
(A) What are method parameters? Explain out and ref parameters with example. (8 Marks)
(B) Write a program to print the difference between the largest and the first elements of a one dimensional integer array. (6 Marks)
(C) What is read-only and write-only Property? Explain read-write property definition with an example. (6 Marks)

Q.4. Attempt the following Questions: (20 Marks)
(A) Design a class named Point2D with data members for storing x coordinate and y coordinate of a point. Include relevant constructors and operator methods so that the following operations can be performed from Main method. (8 Marks)
Point2D p1=new Point2D(20,40);
Point2D p2=new Point2D(50,100);
p1++;
Point2D p3=p1+p2;
(B) Write short note on: (6 Marks)
      (i) Boxing and Unboxing
      (ii) for loop
(C) What is inheritance? Explain about classical inheritance. (6 Marks)

Q.5. Attempt the following Questions: (20 Marks)
(A) Write a program to create a sealed class called StudentExam with data members for storing roll number and marks obtained in 3 subjects of a student. It also has the following constructor and methods: (8 Marks)
1. Constructor that initializes all data members.
2. Method isPassed(), to check whether the student has passed in every subject.
3. Method displayTotal(), for displaying the total marks obtained in all subjects provided the student has scored minimum 40 marks in every subject or else, display the message “Student is failed”.
4. Main method to test the program by creating object of StudentExam class.
(B) What are Interfaces? Explain implementing an interface in a class with an example. (6 Marks)
(C) How is a structure declared? Differentiate between structures and classes. (6 Marks)

Q.6. Attempt the following Questions: (20 Marks)
(A) Explain each of the following with proper syntax and example: (8 Marks)
      (i) Delegate Declaration
      (ii) Delegate Methods
      (iii) Delegate Instantiation
      (iv) Delegate Invocation
(B) What are Private, Protected and Public members of a class? Explain method overloading with example. (6 Marks)
(C) What is Formatted Output? Explain Fixed-Point Formatting and Exponential Formatting with examples. (6 Marks)

Q.7. Attempt the following Questions: (20 Marks)
(A) Write a program to create a class Voter with attributes voter_id, name and age. Include relevant constructors to initialize its data members. If age is less than 18 years, then raise a user defined exception with error message "You are not eligible to vote". (8 Marks)
(B) Write short notes on each of the following: (6 Marks)
      (i) General Catch Handler
      (ii) Finally Block
      (iii) Checked Exceptions
(C) What is Verbatim String? Explain the use of Equals() method and == operator for checking equality of two strings. (6 Marks)

0 Comments