24

VTURESOURCE - Home...Write a C# application which defines a class shape, with four data members length, breadth, height and radius, appropriate constructors and methods …

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

  • 7

    ~ of ~~aRM Institute of Tschnotog'l",".8Dd &toP. BAN~&-1"

    Seventh Semester B.E. Degree Examination, Dec. 07 I Jan. 08

    C # Programming and .NET Concepts. ~ax.~arks:lOO

    .Note: 1. Answer any FIVE full questions.2. Diagrams if any, must be neatly drawn.

    a. What is .NET? With a neat diagram explain the important building blocks of .NET platform.(10Marks)

    b. Explain with a neat diagram the workflow that takes place between your source code, a given.NET compiler and the .NET execution engine. (05Marks)

    c. What are the key features of C#? (05Marks)a. Explain the following aspects ofVS.NET IDE:

    i) Solution Explorer ii) Referencing external assembliesHi) Running and debugging iv) Documenting code via XML.

    b. Write a program to count the objects created for a class. Define your own class.a. Differentiate between the following with an example:

    i) Singlefile and Multifile Assembly ii) Value types and Reference typesHi) Boxing and Unboxing iv) Shallow copy and Deep copy. (10 Marks)

    b. Write a C# application which defines a class shape, with four data members length, breadth,height and radius, appropriate constructors and methods to calculate the volume of cube, coneand sphere. Also write shapeapp, which creates these 3 objects i.e., cube, cone and sphere

    'Using appropriate constructors and calculates their volume with the help of the above classmethods.. (10Marks)

    a. What is encapsulation? What are the two ways of enforcing encapsulation? Give examples forboth methods. (08Marks)

    b. Write a program to define a class vehicle and a class engine. Let the vehicle class containengine. The engine should be started at the source and stopped after reaching the destination.Let the speed and the distance be read. The program should throw an exception when thevehicle tries to travel beyond destination. Develop the application in C #. (12Marks)

    a. What do you understand by the terms errors, bugs and exceptions? Give the importantmembers of the System. Exception class. Illustrate the use of tbis class in throwing genericexceptions. (10Marks)

    b. When do you override the virtual System. Object. Finalise ( ) method? How do youimplement it using destructors? Why do we avoid using destructors in C # application?

    (06Marks)c. Explain how garbage collection is optimized in .NET. (04Marks)a. How are interfaces different from abstract classes? (04Marks)

    b. Explain the polymorphic behaviour of interfaces with example. (06Marks)c. Design an Employee class which is derived from Person class having common behaviour of

    the employees. The employees can exhibit different behaviours like C # experts, Java expert orexpert in both. Develop an application which accepts an employee.array and counts the numberof employee expert in C #, expert in Java and experts in both. Make suitable assumptions.

    (10Marks)a. What is a Delegate? Differentiate between synchronous and asynchronous delegates with

    suitable examples. (12Marks)b. What is an Indexer? Explain with an example. Differentiate between indexer and property.

    (08Marks)a. Explain the two conceptual views of a .NET assembly with neat diagrams. What are the core

    benefits of this format? (12 Marks)

    b. Is cross language inheritance possible on .NET platform? If yes, explain how it is achievedwith an example. (04Marks)

    c. Explain how do you make use of shared assembly in your application. (04Marks)*****

    CS761

    1

    2

    (12Marks)(08 Marks)

    3

    4

    5

    6

    8