Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this exercise, youll use a decision structure and arithmetic expressions to calculate the federal income tax that is owed for a taxable income amount

In this exercise, youll use a decision structure and arithmetic expressions to calculate the federal income tax that is owed for a taxable income amount entered by the user. Then, youll design a method to contain the calculation code, and develop the calling statement to invoke the method.

You can test your step 1 results first (no private methods) and then move on to Step 2, which involves you moving the tax calculation code from the btnCalculate click event to a private method.

This is the 201x table for the federal income tax on individuals that you should use for calculating the tax:

Taxable income

Income tax

Over

But not over

Of excess over

$0

$8,700

$0 plus 10%

$0

$8,700

$35,350

$870 plus 15%

$8,700

$35,350

$85,650

$4867 plus 25%

$35,350

$85,650

$178,650

$17,442 plus 28%

$85,650

$178,650

$388,350

$43,482 plus 33%

$178,650

$388,350

$112,683 plus 35%

$388,350

Start a new project named TaxCalculator.

  1. Add labels, text boxes, and buttons to the default form and set the properties of the form and its controls so they appear as shown above. When the user presses the Enter key, the Click event of the Calculate button should fire. When the user presses the Esc key, the Click event of the Exit button should fire.
  2. Create an event handler for the Click event of the Exit button that closes the form.
  3. Step 1 calculate the tax owed in bntCalculate_Click event handler. This code should provide for decimal entries, and you can assume that the user will enter valid decimal values. However, do better than the screenshot above and actually display the results as currency. Note: The amount of Federal Income Tax owed is usually a whole dollar amount, and the government doesnt round up rather, they convert it to an integer, effectively losing the cents. That is the reason for the amount listed in the screenshot.

Step 2 - Code the declaration for a private method named CalculateTax that receives the income amount and returns the tax amount. Create a statement in the btnCalculate_Click event handler that declares the tax variable which, in turn, gets its value by calling this CalculateTax method.

  1. Create an event handler that clears the Income Tax Owed text box if the user changes the value in the Taxable Income text box.4
  2. Test the application to be sure it works correctly.

*Please do in C#, Windows Forms Application, and Visual Studios*

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design And Implementation

Authors: David M. Kroenke

5th Edition

B000CSIH5A, 978-0023668814

More Books

Students also viewed these Databases questions

Question

Draw a picture consisting parts of monocot leaf

Answered: 1 week ago