Assignment 5 Basic Class Room Questions
Assignment 5 Basic Class Room Questions
In [1]: #Ramesh’s basic salary is input through the keyboard. His dearness allowance is
#house rent allowance is 20% of basic salary. Write a program to calculate his g
In [2]: #The distance between two cities (in km.) is input through the keyboard. Write a
#print this distance in meters, feet, inches and centimeters.
In [3]: #If the marks obtained by a student in five different subjects are input through
#aggregate marks and percentage marks obtained by the student. Assume that the m
#can be obtained by a student in each subject is 100.
In [4]: #Temperature of a city in Fahrenheit degrees is input through the keyboard. Writ
#temperature into Centigrade degrees.
In [5]: #The length & breadth of a rectangle and radius of a circle are input through th
#to calculate the area & perimeter of the rectangle, and the area & circumferenc
file:///C:/Users/Shubham/Downloads/Assignment_5_Basic_class_room_questions.html 1/3
03/08/2024, 23:57 Assignment_5_Basic_class_room_questions
# Rectangle calculations
area_rectangle = length * breadth
perimeter_rectangle = 2 * (length + breadth)
print("Area of the rectangle:", area_rectangle)
print("Perimeter of the rectangle:", perimeter_rectangle)
# Circle calculations
area_circle = 3.14159 * radius * radius
circumference_circle = 2 * 3.14159 * radius
print("Area of the circle:", area_circle)
print("Circumference of the circle:", circumference_circle)
In [6]: #Two numbers are input through the keyboard into two locations C and D. Write a
#the contents of C and D.
After interchanging, C = 2
After interchanging, D = 1
In [7]: #If a five-digit number is input through the keyboard, write a program to revers
In [8]: #If a four-digit number is input through the keyboard, write a program to obtain
#digit of this number.
In [9]: #In a town, the percentage of men is 52. The percentage of total literacy is 48.
#men is 35 of the total population, write a program to find the total number of
#the population of the town is 80,000.
total_population = 80000
men_percentage = 0.52
total_literate_percentage = 0.48
literate_men_percentage = 0.35
file:///C:/Users/Shubham/Downloads/Assignment_5_Basic_class_room_questions.html 2/3
03/08/2024, 23:57 Assignment_5_Basic_class_room_questions
In [12]: #A cashier has currency notes of denominations 10, 50 and 100. If the amount to
#through the keyboard in hundreds, find the total number of currency notes of ea
#cashier will have to give to the withdrawer.
notes_50 = remaining_amount // 50
remaining_amount = remaining_amount % 50
notes_10 = remaining_amount // 10
In [ ]:
file:///C:/Users/Shubham/Downloads/Assignment_5_Basic_class_room_questions.html 3/3