Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
7 views

Programming Assignment With Questions and Python Only by Hibba 7A

The document contains 11 programming assignments involving user input and conditional logic: taking input to check for a square, find the greatest of two numbers, calculate total cost with/without discount, calculate net bonus based on salary and years of service, grade based on marks, find oldest and youngest of three ages, print absolute value, check attendance percentage and ability to sit for exam with/without medical cause, evaluate Boolean expressions, and check case of a character.

Uploaded by

hibba.2003.4b
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Programming Assignment With Questions and Python Only by Hibba 7A

The document contains 11 programming assignments involving user input and conditional logic: taking input to check for a square, find the greatest of two numbers, calculate total cost with/without discount, calculate net bonus based on salary and years of service, grade based on marks, find oldest and youngest of three ages, print absolute value, check attendance percentage and ability to sit for exam with/without medical cause, evaluate Boolean expressions, and check case of a character.

Uploaded by

hibba.2003.4b
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Programming Assignment

Ans1.) Take values of length and breadth of a rectangle from user and check if it is
square or not:

Ans2.) Take two int values from user and print greatest among them:

Ans3.) A shop will give discount of 10% if the cost of purchased quantity is more
than 1000.
Ask user for quantity.
Suppose one unit will cost 100.
Judge and print total cost for user:

Ans4.) A company decided to give bonus of 5% to employee if his/her year of


service is more than 5 years.
Ask user for their salary and year of service and print the net bonus amount:

Ans5.) A school has following rules for grading system:


a. Below 25 – F
b. 25 to 45 – E
c. 45 to 50 – D
d. 50 to 60 – C
e. 60 to 80 – B
f. Above 80 – A
Ask user to enter marks and print the corresponding grade:

Ans6.) Take input of age of 3 people by user and determine oldest and youngest
among them:

Ans7.) Write a program to print absolute value of a number entered by user.


E.g.-
INPUT: 1 OUTPUT: 1
INPUT: -1 OUTPUT: 1
Ans8.) A student will not be allowed to sit in exam if his/her attendance is less
than 75%.
Take following input from user
Number of classes held
Number of classes attended.
And print
percentage of class attended
Is student is allowed to sit in exam or not:
Ans9.) Modify the above question to allow students to sit if he/she has medical
cause. Ask user if he/she has medical cause or not (‘Y’ or ‘N’) and print
accordingly:

Ans10.) If
x=2
y=5
z=0
then find values of the following expressions:
a. x == 2
b. x != 5
c. x != 5 && y >= 5
d. z != 0 II x == 2
e. !(y < 10):

Ans11.) Write a program to check whether a entered character is lowercase


( a to z) or uppercase (A to Z):

You might also like