HWZ Forums

Login Register FAQ Mark Forums Read

need help with algorithm

Like Tree1Likes
  • 1 Post By ykgoh
Reply
 
LinkBack Thread Tools
Old 18-04-2016, 10:57 AM   #1
Junior Member
 
Join Date: Aug 2015
Posts: 7
need help with algorithm

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 by aayhan; 18-04-2016 at 01:44 PM..
aayhan is offline   Reply With Quote
Old 18-04-2016, 11:16 AM   #2
Master Member
 
Join Date: Nov 2006
Posts: 4,062
Have you even attempted it yourself?
Swiftbladez is offline   Reply With Quote
Old 18-04-2016, 11:23 AM   #3
Junior Member
 
Join Date: Aug 2015
Posts: 7
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 by aayhan; 18-04-2016 at 11:59 AM..
aayhan is offline   Reply With Quote
Old 18-04-2016, 04:35 PM   #4
Member
 
Join Date: Feb 2006
Posts: 247
Why not show us what you've done for us to help you along?
sharkkae is offline   Reply With Quote
Old 18-04-2016, 09:03 PM   #5
Master Member
 
Join Date: Jan 2000
Posts: 2,776
Pseudo code in English?
ykgoh is offline   Reply With Quote
Old 19-04-2016, 11:44 AM   #6
Junior Member
 
Join Date: Aug 2015
Posts: 7
Pseudo code in English?
yes, pseudo code in english.
aayhan is offline   Reply With Quote
Old 19-04-2016, 12:31 PM   #7
Master Member
 
Join Date: Jan 2000
Posts: 2,776
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.
aayhan likes this.
ykgoh is offline   Reply With Quote
Old 19-04-2016, 10:15 PM   #8
High Supremacy Member
 
Azzizz81's Avatar
 
Join Date: May 2001
Posts: 37,060
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

Azzizz81 is offline   Reply With Quote
Reply
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. Forum members and moderators are responsible for their own posts.

Please refer to our Terms of Service for more information.


Thread Tools

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On