Question: LAB # 5: CS 109 (Programming-II) Application of Functions Write a proram that would compute income tax of an individual by using two different functions:

 LAB # 5: CS 109 (Programming-II) Application of Functions Write a

LAB # 5: CS 109 (Programming-II) Application of Functions Write a proram that would compute income tax of an individual by using two different functions: a) Function Netincome that takes grossincome (double), noofChildren (int) and option (char) as input parameters. Then it computes the netincome using the following formulae. First check if option is s or s (single), then stdDeduction 8000.00 noofExemption- 1+ noofChildren else if option is j or joint), then stdDeduction 12000.00 noOfExemption 2+ noofchildren else Display a message that the option is invalid and quit the program (exito):) dependentDeduction- noOfExemption 2500.00 totalDeduction stdDeduction + dependentDeduction net income grossincome-tota!Deduction return netincome b) A function Tax that computes the tax by using the netincome as parameter The tax is computed as below If netincome is less than 20000, taxe netincome is above 20000 but less than 50000, tax is 10% of netincome ie. tax- 0.1- netincome f netincome is above 50000, but less than 100000, tax -0.15 netincone f it is above 100000, tax- 0.2"netincome teturn tax c) Main should get three different user input: gross income, nootchildren, and option Then first call the function Netincome and store the value in vaniable netincome. Now call the tunction Tax using netincoms as argument and store the value in vartlable tax. Display the netincome and tax with suitable utle

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!