it must be done using pseudo code Write a Pseudo code program that displays the
ID: 3574922 • Letter: I
Question
it must be done using pseudo code
Write a Pseudo code program that displays the income tax due (in a certain state)on a taxable income entered by the user, according to the tax table that I will include. The program should allow users to enter a series of incomes terminated by 0. Use a class called tax, with attributes INCOME and TAXDUE and methods that include COMPUTETAX. [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
Explanation / Answer
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
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.