Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Majan Electricals company wants to compute the Allowance and Gross pay of its employees. The information of the employee is stored in a file called

image text in transcribed
"Majan Electricals company wants to compute the Allowance and Gross pay of its employees. The information of the employee is stored in a file called "Majan.txt" a) Write a program that will read the employee information in an input file called "Majan.txt". The input file contains the following information: (1 Mark) Muna Director 700.6 900.5 300.50 Female b) Create a function that will read the contents of the input file and display the file content on your screen. (2 Marks) c) Create a function with return value that will compute the Gross pay of the employee by adding the third and fourth lines of the file (700.6 and 900.5). (3 Marks) d) The second line of the file ("Director") represents the position of an employee'. Create a function that willcompute the Allowance based on the position of an employee as shown in the table below and display all the calculated values. (4 Marks) Position of an employee Allowance Director 7% of Gross pay Otherwise 9% of Gross pay

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions