Visual Programming (CS411)

Assignment # 02


Total marks = 20                                                                              

Due Date  =   21st December 2021



Please carefully read the following instructions before attempting assignment.




It should be clear that your assignment would not get any credit if:

  • The assignment is submitted after the due date.
  • The submitted assignment does not open or file is corrupt.
  • Strict action will be taken if submitted solution is copied from any other student or from the internet.




·         Lectures 7 to 14



No assignment will be accepted after the due date via email in any case (whether it is the case of load shedding or internet malfunctioning etc.). Hence refrain from uploading assignment in the last hour of deadline. It is recommended to upload solution file at least two days before its closing date.

If you people find any mistake or confusion in assignment (Question statement), please consult with your instructor before the deadline. After the deadline no queries will be entertained in this regard.

For any query, feel free to whatsapp at 03037155010

                                                                                                                                                                          (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.



·         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

Previous Post Next Post