0% found this document useful (0 votes)
10 views3 pages

Practical Using Selection

The document outlines two Python programming tasks. Task 1 involves creating a program to calculate employee bonuses based on salary and years of experience, and print a payslip. Task 2 requires a program to calculate the net price of products after applying discounts based on the product type and quantity, and print a formatted bill.

Uploaded by

Random Dude
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views3 pages

Practical Using Selection

The document outlines two Python programming tasks. Task 1 involves creating a program to calculate employee bonuses based on salary and years of experience, and print a payslip. Task 2 requires a program to calculate the net price of products after applying discounts based on the product type and quantity, and print a formatted bill.

Uploaded by

Random Dude
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Selection – Python Practicals Extra

Task1:

Write a python program to read employee number , name , job, years of experience and salary then
calculate the bonus using following conditions:

Salary Bonus

>=25000 50% of Salary

>=20000 25% of Salary

>=15000 12 % of salary

>=10000 10% of salary

<10000 5%of salary

Note: The above bonus is applicable , if the employee working experience is 5 years or more.
Otherwise bonus is 500.

Print Employee payslip in the proper format (including all details – line by line)

name=input("enter your name: ")

number=int(input("enter your number: "))

job=input("enter your job: ")

years_of_experience=int(input("enter number of years: "))

salary=float(input("enter your salary: "))

if years_of_experience>=5:

if salary>=25000:

bonus=(50/100)*salary

elif salary>=20000:

bonus=(25/100)*salary

elif salary>=15000:

bonus=(12/100)*salary
elif salary>=10000:

bonus=(10/100)*salary

else:

bonus=(5/100)*salary

else:

bonus=500

print("bonus=",bonus)

Task2:

Write a python program to read product code, name, product type ,qty, price,

The input of product type should be either (garments/ food/ house hold)

then calculate the actual price by multiplying qty with price.

Then calculate net price by subtracting actual price with discount

The condition for discount amount:

Actual Amount Discount

>=1000 150

>=500 120

>=300 100

>=100 50

<100 10

The above discounts are not applicable for food items

Print the bill in the following format:

**********************************************
Bill Amount

**********************************************

Product Code: <pcode>

Product name: <pname>

Product type :< ptype>

Price: <price>

Qty : <qty>

Actual price : <actualprice>

Discount:<discount>

Net Price:<netprice>

**********************************************

Thank u for visiting

**********************************************

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy