Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part 1: Programming - Income Tax Records App 1.1 Problem Statement Due to upcoming end of financial year, you are being called in to write

image text in transcribedimage text in transcribedimage text in transcribed
Part 1: Programming - Income Tax Records App 1.1 Problem Statement Due to upcoming end of financial year, you are being called in to write a program which will ar produce various payroll functions as outlined below. Data: Generate a file called IncomeRec.txt contains a list of Annual income records of employees in firm. You will assume that this firm contains 145 active staff. Each employee record is on a single line and the fields are separated by tabs. The names of the fields are: Employee Last name (Initial) - char FNPF# - integer Age - integer Annual Income - integer An example record may have the following form: F 12345 24 40000 The format of the generated file is shown below. (Note: file doesn't show all records and for clarity, fields here are shown separated by tabs) FNPF# contains a 5 digit number. Annual Income contains a 6 digit number. You will have to use randomization to generate your data so that as to each run of your progra produced a different set of data in the IncomeRec.txt file.Lastname (initial) FNPF# Age Income 12345 24 40000 12361 19 20000 34763 47 100000 11224 50 35000 54129 35 75000 10717 26 28000 1.2 Program Specifications: 1. Generate the IncomeRec.txt file 2. You must read this file and store the records of Annual incomes into appropriate arrays. 3. Your program should then be able to process the following commands. i.e. program should provide user with the following menu. i. Print the entire list. ii. Print list of employees which match a given last name initial iii. Calculate and Print in a file called Income Tax.txt, the tax corresponding to the provided Annual income. iv. Print Payroll Summary V. Exit program. 4. The program should display the menu in 3 above after each command is executed (except menu V which should end the program) 1.2.1 Explanation of each menu item. 1. Print the entire list. This menu item is selected by typing I and it should simply print the contents of the file in suitable format on the screen.(Fields (columns) to display in output are: last name initial, FNPF#, age and Annual Income. 2. Print list of employees which match a given last name initial The user selects this option by typing II Then the user is asked to enter the search initial. If there are employees who have that initial, program prints their record, otherwise if no employees have last names matching the search initial a "no matching record found" message is displayed. 3. Calculate and Print in a file called IncomeTax.txt, the tax corresponding to the provided Annual income. The user selects this option by typing III. The program then calculates and prints to a file Income Tax.txt, the tax corresponding to the provided Annual income. Tax will be calculated using the breakdown given in Section 1.3 . The format of the resultant file is shown below;Lastname (initial) FNPF# Age Income Tax F 12345 24 40000 4000 6 12361 19 20000 2000 H 34763 47 100000 20000 H 11224 50 35000 3500 R 54129 35 75000 15000 6 10717 26 28000 2800 4. Print Payroll Summary User selects this option to show the total number of staff, the total summation of the pay and tax paid by the firm to all its staff. (This can be printed in one line) 5. Exit program User selects this option by typing V. This is when program should end 1.2.2 Use of Functions in Assignment: It necessary that you implement this assignment using functions. To obtain the maximum score you must demonstrate the ability to create and use functions of your own. For example, you may consider creating and using the following functions in your program: 1. A function to read the contents of the file and populate the respective arrays 2. A function the will search and print all employees given a last name initial as search key (argument). 3. A function to calculate the tax corresponding to the provided Annual income 4. A function to calculate and display payroll summary. 1.3 Tax Calculation Age 100 000 65 s Age 150 000 Age > = 80 0% tax on all income (No Tax)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transport Operations

Authors: Allen Stuart

2nd Edition

978-0470115398, 0470115394

Students also viewed these Programming questions