NET Centric Computing · Unit 1 · 8 hrs
Language Preliminaries
Exam-focused notes for Language Preliminaries (NET Centric Computing, CSC378): what the TU syllabus asks and how it has actually been tested, with 13 solved past questions from this unit.
What this unit covers
- Introduction to .Net framework
- Compilation and execution of .Net applications
- Basic Languages constructs
- Constructor
- Properties
- Arrays and String
- Indexers
- Inheritance
- use of "base" keyword
- Method hiding and overriding
- applying polymorphism in code extensibility
- structs and enums
- abstract class sealed class
- interface
- Delegate and Events
- Partial class
- Collections
- Generics
- File IO
- LINQ (Language Integrated Query) Fundamentals: Lambda Expressions
- Try statements and Exceptions
- Attributes: Attribute Classes, Named and Positional Attribute Parameters, Attribute Targets, Specifying Multiple Attributes
- Asynchronous Programming: Principle of Asynchrony, Async/Await patterns in C#
Attributes
Distinguish between collection and generics. What are named and positional attribute parameters? Write a program to create your own exception when the user gives subject name than 'C#'.[10]
--- Basis Collection Generics --------- Namespace System.Collections System.Collections.Generic Type Safety Not type-safe; stores objects of any type Type-safe; stores objects of a specific type Data Type Works with object type (non-generic) Works with a sp...
Full solved answer →What is named and positional attribute parameters? Describe the .Net architecture design and principles. [5]
--- From the notes, the syntax for an attribute is: - Positional parameters are the mandatory parameters of an attribute. - They must be passed in a fixed order as defined in the attribute constructor. - They correspond directly to the constructor arguments...
Full solved answer →Inheritance
Create a class named EMPLOYEE as super class and ENGINEER and DOCTOR as sub class. Make your own assumptions as properties and methods. [5]
This question demonstrates inheritance in C, where a base (super) class EMPLOYEE is created, and derived (sub) classes ENGINEER and DOCTOR inherit its properties and methods. The derived classes extend the base class with their own specific properties and m...
Full solved answer →applying polymorphism in code extensibility
Write short notes on: a. Polymorphism b. Hidden Field [5+5]
--- The word polymorphism means "having many forms." It is the ability of a function, method, or object to behave differently in different contexts. In C, polymorphism can be static (compile-time) or dynamic (run-time). --- The mechanism of linking a functi...
Full solved answer →Partial class
What are the needs for partial class and sealed class? How do you relate delegate with events? State the steps to deploy .NET core application.[10]
--- A partial class allows a single class definition to be split across multiple files. All parts are combined into one class at compile time using the partial keyword. Syntax: Needs / Reasons to use Partial Class: Need Explanation ------------------- Large...
Full solved answer →Generics
Differentiate between generic and non-generic collections. Write a simple program to create generic class with generic constructor, generic member variable, generic property and generic method. [5]
Feature Generic Collection Non-Generic Collection --------- Namespace System.Collections.Generic System.Collections Type Safety Type-safe at compile time Not type-safe (stores object) Boxing/Unboxing No boxing/unboxing needed Requires boxing/unboxing for va...
Full solved answer →LINQ
Write short notes on: (any two) a. Lambda Expression b. Cross Site Request Forgery c. Single Page Application [5+5+5]
--- A lambda expression is an anonymous function that can be used to create delegates or expression tree types. Lambda expressions are a concise way to write inline functions and are heavily used in LINQ (Language Integrated Query) in C. or for a block body...
Full solved answer →Write short notes on: (any two) 1. Lambda Expression 2. Containerization using Docker 3. Delegates and Events [5+5+5]
--- A lambda expression is a convenient way of defining an anonymous (unnamed) function that can be passed around as a variable or as a parameter to a method call. Lambda expressions are closely associated with LINQ (Language Integrated Query), as many LINQ...
Full solved answer →Write short notes on (any two): a. LINQ b. Open Redirected Attack c. Query String [5+5+5]
--- Definition: LINQ (Language Integrated Query) is the name for a set of technologies based on the integration of query capabilities directly into the C language. With LINQ, a query is a first-class language construct, just like classes, methods, and event...
Full solved answer →Collections
What is the purpose of web form? Write a program to demonstrate the concept of collection and generics.[10]
A Web Form in ASP.NET is a page that allows users to interact with a web application by entering and submitting data through HTML form elements such as text boxes, dropdowns, checkboxes, and buttons. Purpose Description ------ Data Collection Collects user ...
Full solved answer →structs and enums
Differentiate between struct and enum. Why do we need to handle the exception? Illustrate with an example with your own customized exception.[10]
--- As per the course notes, the key differences are: Feature Struct Enum --------- Keyword struct keyword is used to declare a structure enum keyword is used to declare an enumeration Contents Can contain both data variables and methods Can only contain da...
Full solved answer →Try statements and Exceptions
Explain error handling in ASP.[5]
Error handling (Exception Handling) in C is a mechanism to detect and handle run-time errors in code. The CLR (Common Language Runtime) supports error and exception handling as one of its core responsibilities. C provides three keywords to implement excepti...
Full solved answer →File IO
Explain about file access with ASP with example.[5]
File access in ASP.NET allows web applications to read from and write to files stored on the server. ASP.NET provides built-in classes through the System.IO namespace to handle file input/output operations. The two main streams used are: - Input Stream: Use...
Full solved answer →Make Unit 1 stick
Practice CSC378 with flashcards & quizzes