Solved

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

Posted on 2010-09-19
3
350 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Why  my code (program) build with old compiler? 11 77
C# Gridview 1 48
Expression Evaluater 3 38
Please explain purpose of GZIP 4 36
The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.

828 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