Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
22 views3 pages

APT1030 Assignment2

The document is a C# program that defines a structure for employee details and calculates their salaries. It prompts the user to input employee names, numbers, and basic salaries, then computes house allowance, gross salary, income tax, and net salary. The program outputs these details, including special handling for income tax based on gross salary thresholds.

Uploaded by

kmdjd2cmzq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views3 pages

APT1030 Assignment2

The document is a C# program that defines a structure for employee details and calculates their salaries. It prompts the user to input employee names, numbers, and basic salaries, then computes house allowance, gross salary, income tax, and net salary. The program outputs these details, including special handling for income tax based on gross salary thresholds.

Uploaded by

kmdjd2cmzq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

RAHMA RAGE- 665615

internal class Program


{

struct employee

public string Employee_Name;

public int Employee_number;

public double Basic_salary;

public double Gross_salary;

public double House_allowance;

public double Income_tax;

public double Net_salary;

};

internal class program

static void Main(string[] args)

employee[] employee = new employee[5];

for (int i = 0; i < 5; i++)

Console.Write("Enter Employee Name:", "\n\n");

employee[i].Employee_Name = System.Convert.ToString(Console.ReadLine());

Console.Write("Enter employee number:", "\n\n");

employee[i].Employee_number = System.Convert.ToInt32(Console.ReadLine());

Console.Write("Enter basic salary:", "\n\n");

employee[i].Basic_salary = System.Convert.ToInt32(Console.ReadLine());

employee[i].House_allowance = 0.4 * employee[i].Basic_salary;


employee[i].Gross_salary = employee[i].House_allowance + employee[i].Basic_salary;

employee[i].Income_tax = 0.3 * employee[i].Gross_salary;

employee[i].Net_salary = employee[i].House_allowance + employee[i].Basic_salary -


employee[i].Income_tax;

if (employee[i].Gross_salary >= 30000)

Console.WriteLine("The income tax is: " + employee[i].Income_tax, "\t");

Console.WriteLine("----------------------------------------");

Console.WriteLine("The gross salary is: " + employee[i].Gross_salary, "\t");

Console.WriteLine("----------------------------------------");

Console.WriteLine("The house allowance is: " + employee[i].House_allowance, "\t");

Console.WriteLine("----------------------------------------");

Console.WriteLine("The net salary is: " + employee[i].Net_salary, "\t");

Console.WriteLine("----------------------------------------");

else

Console.WriteLine("The income tax is 0. ");

Console.WriteLine("----------------------------------------");

Console.WriteLine("The gross salary is: " + employee[i].Gross_salary, "\t");

Console.WriteLine("----------------------------------------");

Console.WriteLine("The house allowance is: " + employee[i].House_allowance, "\t");

Console.WriteLine("----------------------------------------");

Console.WriteLine("The net salary is: " + employee[i].Net_salary, "\t");

Console.WriteLine("----------------------------------------");

Console.ReadKey();
}

You might also like