(Marks 20)
Problem Statement:
You
are required to create a C# Console application using Visual Studio
to calculate area of rectangle with the following functional requirements:
Create
an interface and name it “Shape”. And it will contain declaration of two
methods.
1)
getInput 2) area
Create
a single class
1.
Rectangle
Rectangle
class will have a function getInput() to take input values from user and area()
to calculate the area of respective category.
Your
Program should have the following functionalities:
·
First
you have to take your VUID as a input.
SOLUTION FILE
·
In
the Rectangle class create
a function getInput() in which you will take an input from the user for
the attribute length and width. You
have to take first digit of your VUID as length of rectangle and last two digit
of VUID as a width. For example, if your ID is BS123456789 so your length value
should be 1 and width value should
be 89. Now create a function area()
to calculate the area of rectangle. . (Note: You should also have to check
if the first and last two numeric character of your vu id is zero then your
code should increment it with 1 so in any case your code should not return zero
answer.
This check is compulsory for
every student, whether your vuid has 0 as the starting or ending digit or not)
Post a Comment
Don't Forget To Join My FB Group VU Vicky
THANK YOU :)