Write a program to accept the name and basic salary of an employee. Calculate and display the gross salary and net salary based on the following: da = 20% of the basic salary hra = 10% of the basic salary pf = 12% of the basic salary gross = basic + da + hra net = gross - pf Variable description of the gross salary and net salary program: Variable Data type Description Name String To store the name of the employee Bs Int To store the basic salary Da Int To store the dearness allowance Hra Int To store the house rent allowance Pf Int To store the provident fund Net Int To store the net salary Gross Int To store the gross salary
Added by Shaun H.
Step 1
We can do this using the input function in Python. ```python name = input("Enter the name of the employee: ") bs = int(input("Enter the basic salary of the employee: ")) ``` Show more…
Show all steps
Your feedback will help us improve your experience
Deepak Kumar and 77 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Shelayah R.
Write a program that reads the following information and prints a payroll statement: Employee’s name (e.g., Smith) Number of hours worked in a week (e.g., 10) Hourly pay rate (e.g., 9.75) Federal tax withholding rate (e.g., 20%) State tax withholding rate (e.g., 9%) A sample run is shown below: Enter employee's name: Smith Enter number of hours worked in a week: 10 Enter hourly pay rate: 9.75 Enter federal tax withholding rate: 0.20 Enter state tax withholding rate: 0.09 Employee Name: Smith Hours Worked: 10.0 Pay Rate: $9.75 Gross Pay: $97.5 Deductions: Federal Withholding (20.0%): $19.5 State Withholding (9.0%): $8.77 Total Deduction: $28.27 Net Pay: $69.22
Write a program that computes a weekly salary for an hourly rate employee. Assume that the employee pays a regular hourly rate of P30.00. The overtime rate is P40.00. The first 40 hours are paid using the regular rate, and succeeding hours are paid using the overtime rate. If the total hours worked is more than 55 hours, a "hazard pay" worth P250.00 is added. (Filename: HoursWorked) The program will ask the user for the total number of hours worked in a week and display the equivalent salary. Sample output: Enter the number of total hours worked for the week: 60 Salary for the week is: P2250.00
Liam H.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Watch the video solution with this free unlock.
EMAIL
PASSWORD