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 Allowances 20% of basic salary < 300 300- 499 17% of basic salary 15% of basic salary 13% of basic salary 500 - 599 600 - 699 >= 700 10% of basic salary Page 4 of 5 Include the following comments at the beginning of your code. Make sure that you replace and with your information. # File name: salary.py # Student ID: # Student name:
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 Allowances 20% of basic salary < 300 300- 499 17% of basic salary 15% of basic salary 13% of basic salary 500 - 599 600 - 699 >= 700 10% of basic salary Page 4 of 5 Include the following comments at the beginning of your code. Make sure that you replace and with your information. # File name: salary.py # Student ID: # Student name:
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question

Transcribed Image Text:11:21
1 Snapchat
Assignment 3-section 1
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
Allowances
< 300
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
Include the following comments at the beginning of your code. Make sure that you
replace <YOUR_ID> and <YOUR_NAME> with your information.
# File name: salary.py
# Student ID: <YOUR_ID>
# Student name: <YOUR_NAME>
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images

Knowledge Booster
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.Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education