Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.


Visual Programming (CS411)

Assignment # 01

 

Total marks = 20                                                                              

 

Deadline Date

18th May, 2021

 

 

Please carefully read the following instructions before attempting 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 1 to 6 are covered in this assignment

 

NOTE

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 email at:  cs411@vu.edu.pk

 

                                                                                                                                                          

 

 

 

     (Marks 20)

Problem Statement:

You are required to create a C# Console application using Visual Studio.

Your code should be able to calculate Zakat for gold, silver and cash in hand separately while using the concept of POLYMORPHISM.

  • Your code should work in such a way that you need to create 3 classes, one parent class and other two derived classes.
  • The function that needs to be override would be of Zakat Calculation.
  • For calculating Zakat for cash, you simple have to multiply your amount with 0.025, if you want to calculate it for silver or gold, first you need to know the price of 1 ounce of silver and 1 tola gold in rupees respectively and then calculate zakat afterwards.
  • When you run your code, your code should ask to enter your vu id as an asset on which zakat has to be calculated.
  • After that, you will be given a choice as shown in the output of selecting whether the entered asset is cash in hand, gold or silver.
  • You should choose the category of your choice and screenshot it.

Required Output:

Note:

DO REMEMBER that you must use your VUID as an input in this program.

 

Submission details

Following Files Must be submitted in a single zip or rar file.

·         .cs code file (file name should be your VUID)

·         Screenshot of your output while running three of the conditions.

You are not required to submit the complete project, only copy required file from project folder.

If you do not submit any of the above-mentioned file you will be awarded Marks partially.

 

 

“The End”

Views: 915

Replies to This Discussion

Share the Assignment Questions & Discuss Here.... 

Stay touched with this discussion, Solution idea will be uploaded as soon as possible in replies here before the due date.

CS411 Assignment 01 Spring 2021 Solution Complete solution 

Click on the below link to download the file

CS411_Assignment%2301_Solution-Spring_2021-Complete-Solution.pdf

CS411 Complete Solution File 

Click on the below link to download the file

CS411_Assignment%2301_Solution-Spring_2021-Complete-Solution.docx

CS411 Assignment 1 Solution 2021 | CS411 Assignment No 1 Solution Spring 2021

CS411 Assignment 1 Solution Spring 2021 || Visual Programming || 100% Correct Solution

CS411 Assignment 1 solution spring 2021

Cs411 Assignment1 100% Right Solution With Source Code.

#CS411_Assignment_Solution_Spring_2021​.

CS411 Assignment 01 Spring 2021 Solution Complete solution 

Click on the below link to download the file

CS411_Assignment%2301_Solution-Spring_2021-Complete-Solution.pdf

CS411 Assignment 01 Spring 2021 Solution

 

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"); ;
int vuid = Convert.ToInt32(Console.ReadLine());

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"); ;

int option = Convert.ToInt32(Console.ReadLine());

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;
}


}
}
}

CS411 Complete Solution File 

Click on the below link to download the file

CS411_Assignment%2301_Solution-Spring_2021-Complete-Solution.docx

RSS

Looking For Something? Search Below

VIP Member Badge & Others

How to Get This Badge at Your Profile DP

------------------------------------

Management: Admins ::: Moderators

Other Awards Badges List Moderators Group

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service