7
Answers

multiply a decimal, simple help for a noob

aaa

aaa

16y
4.8k
1
So I'm able to do some simple multiplication but once I add a decimal I'm lost...

Goal.. type in an hourly wage and calculate a yearly salary (multiply by 2080)
Then Calculate take home after taxes (multiply 'yearly salary'  by .8)

Here is a link to the full project incase the copy paste code doesn't contain all the information...

C# form application..

Thanks!!

Begin Code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Salary_Calculator_13
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnCalculate_Click(object sender, EventArgs e)
        {

            int salary = 2080 * int.Parse(txthourly.Text);
           
           lblamountyr.Text = salary.ToString();
        }

        private void btnaftertaxes_Click(object sender, EventArgs e)
        {
           int aftertax;
            //aftertax = .8 * int.Parse (lblamountyr.Text);
            //But I don't know how to handle decimals yet and the above no worky


           lblamounttx.Text = aftertax.ToString();
        }

       

        
    }
}
Answers (7)