Program 2: Write a Python program to accept employee name and basic salary of n number of employees and calculate total salary of each employee according to the following formula Total salary = Basic salary + Allowances The value of n should also be accepted as input. All amounts should be displayed with three decimal places The output should be displayed as a table containing the Employee name, Basic salary, Allowances and Total Salary as shown below. The program must define and use a function with basic salary as a parameter and should calculate and return the allowance.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section: Chapter Questions
Problem 8PP: (Statistical) In many statistical analysis programs, data values considerably outside the range of...
icon
Related questions
Question
100%
Program 2: Write a Python program to accept employee name and basic
salary of n number of employees and calculate total salary of each
employee according to the following formula
Total salary = Basic salary + Allowances
The value of n should also be accepted as input.
All amounts should be displayed with three decimal places
The output should be displayed as a table containing the Employee name,
Basic salary, Allowances and Total Salary as shown below.
The program must define and use a function with basic salary as a
parameter and should calculate and return the allowance.
Sample output
Employee Name
Basic salary
Allowances
Total Salary
Ahmed Ali
500.000
75.000
575.000
Fatima Mohammed
1000.000
100.000
1100.000
The allowances should be calculated according to the following table.
Basic salary
< 300
Allowances
20% of basic salary
300 – 499
17% of basic salary
500 - 599
15% of basic salary
600 699
13% of basic salary
>= 700
10% of basic salary
Page 4 of 5
Transcribed Image Text:Program 2: Write a Python program to accept employee name and basic salary of n number of employees and calculate total salary of each employee according to the following formula Total salary = Basic salary + Allowances The value of n should also be accepted as input. All amounts should be displayed with three decimal places The output should be displayed as a table containing the Employee name, Basic salary, Allowances and Total Salary as shown below. The program must define and use a function with basic salary as a parameter and should calculate and return the allowance. Sample output Employee Name Basic salary Allowances Total Salary Ahmed Ali 500.000 75.000 575.000 Fatima Mohammed 1000.000 100.000 1100.000 The allowances should be calculated according to the following table. Basic salary < 300 Allowances 20% of basic salary 300 – 499 17% of basic salary 500 - 599 15% of basic salary 600 699 13% of basic salary >= 700 10% of basic salary Page 4 of 5
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Datatypes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr