0% found this document useful (0 votes)
2 views1 page

Practice Sheet 2

The document outlines a practice sheet with programming exercises aimed at building basic skills in Python. Tasks include creating a simple calculator, comparing strings, finding the largest number among three inputs, categorizing employee salaries into grades with corresponding bonuses, and implementing conditional logic for various scenarios. Additional exercises involve checking triangle formation based on angles and using nested if statements to print specific outputs based on numerical conditions.

Uploaded by

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

Practice Sheet 2

The document outlines a practice sheet with programming exercises aimed at building basic skills in Python. Tasks include creating a simple calculator, comparing strings, finding the largest number among three inputs, categorizing employee salaries into grades with corresponding bonuses, and implementing conditional logic for various scenarios. Additional exercises involve checking triangle formation based on angles and using nested if statements to print specific outputs based on numerical conditions.

Uploaded by

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

Practice sheet 2

1- Write a program to build a simple calculator (+, - , * and / operators). Get input
from user via menu and use ifs to calculate accordingly.
2- WAP to get two strings from user and check if they are equal.
3- WAP to input number ‘a’ and ‘b’ and ‘c’, check the largest number among them
and display result.
4- WAP to get monthly salary details from employee, Employees are categorized in
3 grades-
40,000 > Salary <= 80,000 à Grade A
80,000> Salary <=1,20,000 à Grade B
Salary >1,20,000 à Grade C
Check the Grade of the employee, now calculate the bonus for the employee on
basis of Grades and department, follow along the table below –
Grade Department Bonus
A Marketing 10 %
A Sales 20 %
B Marketing 15 %
B Sales 25%
C All 30 %

Display the bonus and get department info from employee.


5- WAP to get two numbers, follow the instructions and display proper results –
• If both numbers are odd à multiply by 10
• If both numbers are evenà divide by 10
• If one is even and other is odd à swap the numbers and display
6- Input three angles and determine if they can form a triangle or not.
7- WAP to implement below tree via if else or nested ifs –
• N<100
o N<50
§ N<0 – Print( “India”)
§ N>=0 – Print(“Africa”)
o N>=50
§ N<70 – Print(“China”)
§ N>=70- Print(“Korea”)
• N>=100
o N<200 – Print(“UAE”)
o N>=200 – Print(“Europe”)

You might also like