AU Study/TAFE

w6 Fri morning

Last72 2017. 8. 29. 09:34
// Woongyeol_choi



// P453075



// 25/08/2017



// AT1.2_Q4



using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;



namespace Woongyeol_Choi_p453075_AT1._2_Q4

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }



        private void btnCalculate_Click(object sender, EventArgs e)

        {

            int income, tax;



            textTax.Text = "";



            if(!(Int32.TryParse(textIncome.Text, out income)))

            {

                MessageBox.Show("You must enter a number, please try again.");

                return;

            }



            if (income <= 18200)

            {

                textTax.Text = "Nill";

            }

            else if (income <=37000)

            {



                textTax.Text = "" + ((income - 18200) * 0.19);

            }

            else if (income <= 80000)

            {

                textTax.Text = ""  + (( income - 37000) * 0.325 + 3572);

            }

            else if (income <= 180000)

            {

                textTax.Text = "" + ((income - 80000) * 0.37 + 17547);

            }

            else

            {

                textTax.Text = "" + ((income - 180000) * 0.45 + 54547);

            }





        }

    }

}