LAB02
LAB02
Introduction
For example, let us consider a Rectangle object. It has attributes such as length and width.
Depending upon the design, it may need ways for accepting the values of these attributes,
calculating the area, and displaying details.
Let us look at implementation of a Rectangle class and discuss C# basic syntax –
Task:
01) Create a variable called name of type string and assign it the value
"John".
Input:
Output:
---------------------------------------------------------------------------
02) Create a variable called myNum of type int and assign it the
value 15.
Input:
Output:
---------------------------------------------------------------------------
03) Declare a variable without assigning the value, and assign the
value later:
Input:
Output:
-----------------------------------------------------------------------------
04) Perform Decision Making: Equality and Relational Operators
program given in theory lecture using Classes, Variable and Objects.
Input:
Output:
--------------------------------------------------------------------
05) Make a class EvenODD, which checks whether the number you
input is an Even or Odd number.
Input:
Ouput:
-----------------------------------------------------------------------------
06) Give real time examples (3) of four principles of OOP in your own
words.