Solved

How do I create a simple benefits calculator in C# using visual studio 2008

Posted on 2010-09-19
3
344 Views
Last Modified: 2013-12-16
I'm using visual studio 2008 and wanting to create a basic wage and benefit calculator.
my form design will be:
Enter your name: output "txtenteryourname"
Earnings: output "txtearnings"
Interval: group with three radio buttons . hourly, weekly, montly:

Monlhly Deductions: with two labels health and 401k output for both txthealth and txt401k

I must calculate on montly deductions no matter the interval selected

display any error messaage
display taxable income let say 0.6D
concatenate the same along with the results
result displayed at bottom of form

I just need a point in the right direction...thanks
0
Comment
Question by:Want2beAcodebuster
3 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 250 total points
ID: 33713820
Use Decimal.TryParse() to convert the String entered by the user into a decimal value that you can perform calculations on:
http://msdn.microsoft.com/en-us/library/9zbda557.aspx

    string value = txtenteryourname.Text;
    decimal earnings;

    if (Decimal.TryParse(value, out earnings))
    {
        // perform a calculation with "earnings"
    }
    else
    {
        MessageBox.Show("Invalid earnings: " + value);  
    }
0
 
LVL 29

Expert Comment

by:Kumaraswamy R
ID: 33714940
0
 

Author Closing Comment

by:Want2beAcodebuster
ID: 33859696
I was able to part of this solution
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question