CS411 Assignment Solution # 2nd Fall 2021

CS411 Assignment Solution # 2nd Fall 2021

CS411 Assignment Solution # 2nd Fall 2021

CS411 Assignment Solution # 2nd Fall 2021

Please carefully read the following instructions before attempting the assignment.

RULES FOR MARKING

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:

  • Lectures 7 to 14

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)

After taking all values from user when you press enter a window form will appear as shown in below figure.

When you click on calculate button, a built-in delegate function should invoke and a dialog box that will display Area of rectangle appear on screen.

Remember that you don’t need to create custom delegate for this purpose, just use built-in delegate code in your application.

CS411 Second assignment fall 2021

CS411 second assignment fall 2021

Kindly change the file extension to .cs from .txt and make some changes.
If you want to run the file, You will need Visual Studio with added references of Windows form and Drawing

For More Assignment Details

CS411 Assignment Solution # 2nd Fall 2021#CS411 Assignment Solution # 2nd Fall 2021#CS411 Assignment Solution # 2nd Fall 2021

Leave a Reply

Your email address will not be published.