need help with algorithm

aayhan

Junior Member
Joined
Aug 11, 2015
Messages
7
Reaction score
0
Solution algorithm with

1. defining problem
2. Pseudo code algorithm

Design an algorithm to accept income from the user; compute the income tax to be paid and display the income and the tax payable on the screen.

Income tax calculation based on "IRAS (For YA 2012 to YA 2016)"
 
Last edited:

aayhan

Junior Member
Joined
Aug 11, 2015
Messages
7
Reaction score
0
As i am new and am still learning, thus i have tried and have only gotten to the defining diagram. But am still unsure if i am right, therefore i decided to seek some assistance. Kindly assist, thank you.
 
Last edited:

ykgoh

Master Member
Joined
Jan 1, 2000
Messages
2,782
Reaction score
0
The core part of this is a series of if-else conditions to apply different tax rates at different income amount.

Several ways to implement. Simplistic way by most beginner programmers is multiple if else in a block.

More advanced way can involve loop or arithmetics to tally the tax amount.

Give u hint liao.
 

Azzizz81

Suspended
Joined
May 4, 2001
Messages
49,375
Reaction score
2,288
Take a look at https://www.iras.gov.sg/irashome/Quick-Links/Calculators/.

To code a tax calculator is challenging. You have to determine what pay components are taxable and not, what things you are eligible for tax rebates, which year which rules are applicable, on top of the calculation of the tax depending on which income bracket you fall into.

A more sophisticated approach involves modeling the calculation into objects and rules which you can inspect at each step of the computation :o

Sent from the Matrix using GAGT
 
Important Forum Advisory Note
This forum is moderated by volunteer moderators who will react only to members' feedback on posts. Moderators are not employees or representatives of HWZ Forums. Forum members and moderators are responsible for their own posts. Please refer to our Community Guidelines and Standards and Terms and Conditions for more information.
Top