# CS411 Assignment 1 Solution 2021

Dear Students in this post we provide you CS411 Assignment 1 Solution 2021. Get to Download CS411 Assignment 1 Solution 2021 File.

Check New CS411 Assignment Here

CS411 ASSIGNMENT 1 SOLUTION SPRING 2021

SOLUTION CODE:

using System;

namespace cs411

{

class Zakat

{

public virtual void zakat_Calculation(int amount)

{

Console.WriteLine("Calculating Rupees Zakat");

Console.WriteLine("Total Zakat to be Paid : " + amount * 0.025);

}

}

class Gold_Zakat : Zakat

{

public override void zakat_Calculation(int amount)

{

float one_ounce_amount = 1821;

if (((float)amount / one_ounce_amount) >= 3.08)

{

// Because Zakat is on 7.5 tola Gold and 3.08 ounce

// is equal to 7.5 tola Gold.

Console.WriteLine("Calculating Gold Zakat");

Console.WriteLine("Total Zakat to be Paid : " + amount * 0.025);

}

else

{

Console.WriteLine("Your Amount is not enough for Gold Zakat");

}

}

}

class Silver_Zakat : Zakat

{

public override void zakat_Calculation(int amount)

{

float one_ounce_amount = 28;

if (((float)amount / one_ounce_amount) >= 21.59)

{

// Because Zakat is on 52.5 tola Silver and 21.59 ounce

// is equal to 52.5 tola Silver.

Console.WriteLine("Calculating Silver Zakat");

Console.WriteLine("Total Zakat to be Paid : " + amount * 0.025);

}

else

{

Console.WriteLine("Your Amount is not enough for Silver Zakat");

}

}

}

class Program

{

static void Main(string[] args)

{

Console.WriteLine("Enter the Numeric Characters of Your VU ID as your Assets"); ;

Console.WriteLine("If you want to calculate Zakat of your amount in rupees Then Press 1" +

"\nIf you want to calculate Zakat of your amount in Gold Then Press 2" +

"\nIf you want to calculate Zakat of your amount in Silver Then Press 3"); ;

switch (option)

{

case 1:

Zakat zakat = new Zakat();

zakat.zakat_Calculation(vuid);

break;

case 2:

Zakat gold_zakat = new Gold_Zakat();

gold_zakat.zakat_Calculation(vuid);

break;

case 3:

Zakat silver_zakat = new Silver_Zakat();

silver_zakat.zakat_Calculation(vuid);

break;

default:

Console.WriteLine("Enter Correct Number");

break;

}

}

}

}

RESULT:

Note: Run your code and try student id or a different number for makes changes in assignment

Make sure you can make some changes to your solution file before submitting copy-paste solution will be marked zero.

If you found any mistake then correct yourself and inform me.

Before submitting an assignment check your assignment requirement file.

If you need some help and question about files and solutions.

MORE ANY ASSIGNMENTS SOLUTION FREE