I know I am new here but I need help with this assigenment that I am working on.

[Tax Table]

From To Tax due
$0 $50,000 $0 + 5% of amount over $0

$50,000 $100,000 $2,500 + 7% of amount over $50,000

$100,000 ... $6,000 + 9% of amount over $100,000
Program
Declare Public Class tax
Declare Public Property INCOME As Integer;
Declare Public Property TAXDUE As Float With Precision 2, Size 3;

Declare Public Method NEW(income As Integer = 0)
this.INCOME = income;
this.TAXDUE = 0.00
End Public Method NEW

Declare Public Method COMPUTETAX
If this.INCOME Is Less Than Or Equal To 50000 Then
this.TAXDUE = this.INCOME * 0.05;
Else If this.Income Is Less Than Or Equal To 100000 Then
this.TAXDUE = (this.INCOME * 0.07) + 2500;
Else
this.TAXDUE = (this.INCOME * 0.09) + 6000;
End If
End Public Method COMPUTETAX

End Public Class


BEGIN main program BEGIN
Use Class tax;
Declare input As Integer;
Declare taxtotal As Float With Precision 2, Size 3

Do 
Prompt "Input a salary (enter 0 To exit): " + Line Break;
input = User Input;
Declare salary As New tax(input);
taxtotal = salary.COMPUTETAX;
Output "The tax for salary of " + input + " is " + taxtotal + Line Break;
Loop While input Is Not Equal To 0

END main program END

Recommended Answers

All 4 Replies

Can you help me with part 2 and 3. I completed part one as you can see in the above answer.

Thank you for your help. This class is very tough for me.

  1. Using a similar approach as example 3.6 (textbook page 147): “A new Car Price Calculator”, provide your analysis for the following problem statement:

Write a program to compute the income tax due on a taxable income entered by the user. Please refer to Programming Problem 5 (Pg. 162) for the details of this program.
Your analysis should be clearly written and demonstrate your thought process and steps used to analyze the problem. Be sure to include what is the required output? What is the necessary input and how you will obtain the required output from the given input? Also, include your variable names and definitions. Be sure to describe the necessary formulas and sample calculations that might be needed.

  1. Using a similar approach as example 3.6 (textbook page 147): “A new Car Price Calculator”, provide your program design for the program you analyzed from Step 1. Be sure to describe the fundamental tasks (i.e., things your program must do) needed to solve the problem so you can use a modular design. Provide pseudocode of your overall design that includes the Main module and the order of the module calls (see page 148 for an example), a Hierarchy chart (see figure 3.8 page 148), and flow chart (Raptor only). Finally, list all of your pseudocode for each module. (See pages148-151 as an example.)

Include header and step comments in your pseudocode, using a similar approach as the example provided in section 2.3 (textbook page 86). See example 2.8 on pages 87-88).

Prepare at least 5 sets of input data (Test data) along with their expected output for testing your program. Your test data can be presented in the form of a table as was shown in Assignment 1. Be sure that you provide expected output for each test case.

Any input would help. I hope I have this in the right section.

You don't. This is C#. That's not C#.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.