[go: up one dir, main page]

0% found this document useful (0 votes)
38 views2 pages

Assignment1 Decision Control

The document provides instructions for 10 Python programming assignments involving decision control statements (if/else). The assignments include: 1) Converting temperatures between Fahrenheit and Centigrade. 2) Calculating sales bills with discounts over $1000. 3) Determining driver insurance eligibility based on marital status, sex, and age. 4) Identifying odd and even numbers. 5) Finding the greatest of two numbers. 6) Identifying positive and negative numbers. 7) Calculating employee gross salary based on basic salary. 8) Calculating student divisions based on percentage marks. 9) Printing squared or cubed values based on positive, negative, or zero inputs. 10) Identifying leap years.
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)
38 views2 pages

Assignment1 Decision Control

The document provides instructions for 10 Python programming assignments involving decision control statements (if/else). The assignments include: 1) Converting temperatures between Fahrenheit and Centigrade. 2) Calculating sales bills with discounts over $1000. 3) Determining driver insurance eligibility based on marital status, sex, and age. 4) Identifying odd and even numbers. 5) Finding the greatest of two numbers. 6) Identifying positive and negative numbers. 7) Calculating employee gross salary based on basic salary. 8) Calculating student divisions based on percentage marks. 9) Printing squared or cubed values based on positive, negative, or zero inputs. 10) Identifying leap years.
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/ 2

Vivekananda Institute of Professional Studies – Technical Campus

(Affiliated to GGSIP University, Delhi, Recognized by AICTE)


Vivekananda School of Information Technology

Subject : Python Programming lab Dated: 12/09/23

Course & Semester:BCA-3rd Semester Faculty: Dr. Neetu Goel

Lab Assignment 2: Decision Control Statement(if)

1. Write a python program to accept a temperature in Fahrenheit degree and convert it


into Centigrade degrees and print both temperatures.
2. A grocery shop decides to give its customers a discount on the total purchases if it
exceeds Rs. 1000. The quantity purchased and price per item is entered through the
keyboard. Write a python program to calculate the final sales bill.
3. A company insures its drivers in the following cases:
• If the driver is married.
• If the driver is unmarried, male & above 30 years of age.
• If the driver is unmarried, female & above 25 years of age
• In all other cases, the driver is not insured. If the marital status, sex and age of the
driver are the inputs.
Write a program to determine whether the driver should be insured or not.
4. Write a program to find out given number is odd or even
5. Write a program to find out the greatest number in two numbers using if & conditional
operator.
6. Accept a non-zero integer as input. Print positive if it is greater than zero and negative if
it is less than zero.
7. In a company an employee is paid as under:
• If his basic salary is less than Rs. 1500, then HRA = 10% of basic salary and DA = 90%
of basic salary.
• If his salary is either equal to or above Rs. 1500, then HRA = Rs. 500 and DA = 98% of
basic salary.
If the employee's salary is input through the keyboard write a program to find his gross
salary.
8. Percentage marks obtained by a student are input through the keyboard. The student
gets a division as per the following rules:
• Percentage above or equal to 60 - First division
• Percentage between 50 and 59 - Second division
• Percentage between 40 and 49 - Third division
• Percentage less than 40 - Fail
Write a program to calculate the division obtained by the student.
9. Given a number n we wish to do the following:
• If n is positive - print n * n, set a flag to true
• If n is negative - print n * n * n, set a flag to true
• if n is 0 - do nothing

10. Write a program to find out input year is leap year or not.

You might also like