You are on page 1of 2

Assignment #1: FALL-2020 SDT.

Max Marks: 10

Write the assignment with care and write by hand and upload the scanned pdf copy.

Rules:

- No copy paste is allowed from internet or other sources or with other members.

- Plagiarism policy to be strictly followed. Copied assignments will be marked zero (both parties).

- Group based assignment is not allowed.

- Assignments to be submitted in both soft form on vle

Q #1: (1 mark)
Write the code manually of “Contact” and ensure you understand the concept of abstraction and
encapsulation by exposing ‘Properties’ and hiding ‘member fields’. (appendix A below)
Q #2 (1 marks)
Write the code manually of “Contact” and ensure you understand the concept of polymorphism by
exposing ‘Properties’ and hiding ‘member fields’. Espacially see the ‘virtual’ and ‘override’ keywords
used in the code. (appendix A below)
Q#3 (1 mark)
Define Abstraction in detail (max 10 lines with picture)?
Q #4 (1 mark)
Write five differences between abstract base class and an interface. Define a real-world scenario
where abstract class is preferred over and interface.
Q #5 (2 mark)
public string EmailAddress
This is a property in Q#1. Try to modify its code so that the set method only accept valid email
addresses. For example in some one pass basharat@@abc….com then it should not accept and throe
exception.
Hint: try to find and use regular expression
Q #6: (1 mark)
What is design pattern. Why we use them? Explain at least in 10 lines.
Q #7 (1 mark)
Write a note on open-close principle in SOLID? (10 lines max)
Q #8 (2 mark)
Description of the system:
You are required to implement a system for a licensing authority. The system will facilitate
the registered users to appear in an online test and after clearing the test they can request
for the practical test.
There will be 2 roles of the system users:
1- Guest
2- Administrator
Write a C# class where ‘Person’ is a base concept and use polymorphism to demonstrate
the registration process of Guest and Administrator.
Try to use ‘’virtual’ keyword some where and explain why you did not use ‘abstract’
keyword there? Provide your justification.

You might also like