티스토리 뷰

AT1.2_Q4

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


        }
    }
}
 

idle / test value 37500





AT1._2_Q5

// 28/08/2017

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 AT1._2_Q5
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnstart_Click(object sender, EventArgs e)
        {
            listoutput.Items.Clear();

            int loop, divisor, remainder;

            if (!(Int32.TryParse(boxloop.Text, out loop) && Int32.TryParse(boxdivisor.Text, out divisor)))
            {
                MessageBox.Show("Please enter a number, please.");
                return;
            }

            for(int i=1; i <= loop; i++)
            {
                remainder = i % divisor;
                if(remainder==0)
                {
                    listoutput.Items.Add(i);
                }
                
            }
        }
    }
}


idle / test value 17, 3


'AU Study > TAFE Assessment' 카테고리의 다른 글

c sharp programing at 2 teardown  (0) 2017.10.28
C sharp programming AT 1.1  (0) 2017.10.25
C sharp programming AT 1.4  (0) 2017.10.25
Javascript Portfolio  (0) 2017.10.24
C sharp programming AT 2  (1) 2017.10.22
댓글
Announcement
Recent Posts
Recent Comments
Total
Today
Yesterday
Link
TAG
more
«   2024/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
Search by month