Problem Statement
During the tax season, L&T Accounting Firm provides assistance to people who want to prepare their own tax returns. The company only services personal (individual) taxpayers.
Your task is to write a program to do the tax calculation for each of the personal clients.
Your program should get the following input from the users:-
1. General information: name, gender, marital status, no of children (if applicable), wife and husband information (if applicable)
2. Taxable income
3. Tax relief information based on Table 1b below.
4. Amount already deducted from salary through PCB deductions
Formulas involved:-
Chargeable Income = Taxable income – Tax Reliefs
Tax payable/Tax paid in Excess = Income Tax – PCB deductions
To compute income tax, you would have to refer to the income tax rates as shown in Table 1a below. We follow a progressive tax schedule. [NOTE: Please do some research on progressive tax schedule if unsure]
Table 1a: INCOME TAX RATES

RM2,500 0% RM0 Nil
RM2,501 – RM5,000 1% RM25 1 sen for each ringgit over RM2,500
RM5,001 – RM10,000 3% RM175 RM25 plus 3 sen for each ringgit over RM5,000
RM10,001 – RM20,000 3% RM475 RM175 plus 3 sen for each ringgit over RM10,000
RM20,001 – RM35,000 7% RM1,525 RM475 plus 7 sen for each ringgit over RM20,000
RM35,001 – RM50,000 12% RM3,325 RM1,525 plus 12 sen for each ringgit over RM35,000
RM50,001 – RM70,000 19% RM7,125 RM3,325 plus 19 sen for each ringgit over RM50,000
RM70,001 – RM100,000 24% RM14,325 RM7,125 plus 24 sen for each ringgit over RM70,000
Above RM100,000 26% RM14,325 plus 26 sen for each ringgit over RM100,000

Examples of calculating income tax:-
Example 1:
Chargeable income: RM20,000
Tax = RM475 of tax. This can be done by either calculating each tax rate one by one (0% x RM2,500 + 1% x RM2,500 + 3% x RM5,000 + 3% x RM10,000 = RM475) or using the Cumulative Tax column.
Example 2:
Chargeable income: RM25,000, you will have to pay RM475 + (7% x RM5,000) = RM475 + RM350 = RM825 of tax.
Table 1b: PERSONAL RELIEFS (Note: Observe the maximum amount for each type of relief!!)

Taxpayer – Residents (everyone gets this relief) 9,000
Medical expenses for parents (Maximum) 5,000
Medical expenses for taxpayer, spouse and children on serious diseases (including RM 500 for medical examination expenses) (Maximum) 5,000
Wife – if she has no total income 3,000
Husband – if he has no total income 3,000
Children:
Per child below the age of 18 years 1,000
Life insurance premiums / Approved fund contributions / Private pension fund (Maximum)6,000
Private retirement scheme / Deferred annuity premium (Maximum)3,000
Insurance premiums for education or medical benefits (Maximum)3,000
Purchase of books, journals, magazines and other similar publications for the use of taxpayer, spouse or children (Maximum)1,000
Purchase of computer (once in three years) (Maximum)3,000
Purchase of sports equipment (maximum)300
Broadband subscription (maximum)500


Your task is to write a menu-driven program, consisting of 3 main options:-
1. Calculate the tax payable or tax paid in excess, showing all details as per example below. It should display the taxable income, total deductions from personal relief, chargeable income, income tax and tax payable or tax paid in excess.
2. Print summary of all transactions (The summary should display: 1. The number of individual taxpayers, 2. Total tax payable, 3. Total tax refund)
3. Exit application

• Your program should have an introductory welcome screen showing details of company and information on tax rates and personal relief (as shown in Table 1a and Table 1b) and the 3 options listed above.
• Your program should loop until user chooses to terminate the loop. It must be able to keep track of ALL transactions until the user decides to stop.
• There should be 2 ways to terminate application, which is either choosing option 3 from menu or after each transaction, ask user if he or she wishes to continue.
• There should also be 2 ways to view summary, which is either choosing option 2 from menu or when user chooses to terminate application (as the point above).
• Your program must contain at least 5 functions excluding the main function (you can have more than 5).
• Do not use global variables.
• Include necessary input validation and error checking.
Your program should fulfill all the requirements above and the output should be presented in a clear and well-formatted display.
Example input/output for option 1: (User input is in bold, (NOTE: For the ones italicized, you have to determine the right information to be input and only if applicable)
-INPUT-
Name: James Rodney
Gender: Male
Marital Status:Married
No of Children:2
TAXABLE INCOME:RM60,000
PCB Deductions:RM2,300
Taxpayer – Residents :9,000
Medical expenses for parents :0
Medical expenses for taxpayer, spouse and children on serious diseases:0
Wife – if she has no total income:0
Husband – if he has no total income:0
Children:2,000
Life insurance premiums / Approved fund contributions/Private pension fund:6,000
Private retirement scheme / Deferred annuity premium :0
Insurance premiums for education or medical benefits :1,500
Purchase of books, journals, magazines and other similar publications for the use of taxpayer, spouse or children :500
Purchase of computer (once in three years):0
Purchase of sports equipment:0
Broadband subscription:500

-OUTPUT-
Name:James Rodney
Taxable IncomeRM60,000
Total Personal Relief:RM19,500
Chargeable Income:RM40,500
Income Tax:RM2,185
PCB Deductions:RM2,300
Tax Paid In Excess:RM115

Illustration showing how calculations were done (in the background):-
You do not need to display this. Just serves as a guide on calculation
Total Personal Relief = (RM 9,000 + RM2,000 + RM6,000 + RM1,500 + RM500 + RM500)=RM19,500
Chargeable Income = Taxable Income – Tax Relief = RM60,000 – RM19,500 = RM40,500
Income Tax (refer table 1a)
Income tax = RM1,525 + (12% x RM5,500) = RM2,185
Tax payable/Tax paid in excess = Income Tax – PCB deductions
Tax paid in excess = RM2,185 – RM2,300 = RM115

Recommended Answers

All 4 Replies

Suggestion: Start coding!

good advice but so far i had only learn until if else structure.. a little help will be appreciated

You're given all the information, including the mathematics you need as part of the question.

Why did you only decide this was worth looking at two days before the deadline? If you'd have at least read the assignment a week ago, you could have approached someone and asked for help, including your lecturer.

My suggestion is that you fail the course and re-take it. It's obvious you either A) skipped class a lot, B) don't understand the core course material. So I know it sounds a bit harsh, but failing the module is probably the best thing for you to do.

At the very least go to your lecturer, be honest and perhaps they will give you a small extension in which you can get it done.

By asking someone else to work for you, you're only hurting yourself.

---------

At the very least, start reading about object oriented programming and design something on paper. At least you'll have something to present to your lecturer.

You know, I wish I had done a programming class. I really do. I wasn't lucky enough to get into that as my area doesn't provide it.

Congratulations for ruining your own education.

Harsh but true.

commented: Well said! I don't know why people even bother with education, they don't know how luck they are. +7
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.