Page 202 - Computer Science V2.0 Class 11
P. 202
mass = float(input("Enter the mass of object(Kg): "))
print(f'Amount of energy : {computeEnergy(mass)} Joule')
21. Presume that a ladder is put upright against a wall. Let variables length and angle store the length of the ladder and the angle that it
forms with the ground as it leans against the wall. Write a Python program to compute the height reached by the ladder on the wall for
the following values of length and angle:
a. 16 feet and 75 degrees
b. 20 feet and 0 degrees
c. 24 feet and 45 degrees
d. 24 feet and 80 degrees
Ans. import math
def heightReached(length,angle):
ladderHeight = round(length * math.sin(math.radians(angle)),2)
return ladderHeight
print("Height reached by the ladder on the wall for the length is 16 feet and 75
degrees:",heightReached(16,75))
print("Height reached by the ladder on the wall for the length is 20 feet and 0
degrees:",heightReached(20,0))
print("Height reached by the ladder on the wall for the length is 24 feet and 45
degrees:",heightReached(24,45))
print("Height reached by the ladder on the wall for the length is 24 feet and 80
degrees:",heightReached(24,80))
CASE STUDY-BASED QUESTION
1. Schools use “Student Management Information System” (SMIS) to manage student-related data. This system provides facilities for:
• recording and maintaining personal details of students.
• maintaining marks scored in assessments and computing results of students.
• keeping track of student attendance.
• managing many other student-related data. Let us automate this process step by step.
Identify the personal details of students from your school identity card and write a program to accept these details for all students of your
school and display them in the following format.
Name of School
Student Name: PQR Roll No: 99
Class: XI Section: A
Address: Address Line 1
Address Line 2
City: ABC Pin Code: 999999
Parent's/ Guardian's Contact No: 9999999999
DOCUMENTATION TIPS
It is a fact that a properly documented program is easy to read, understand and is flexible for future development. Therefore, it is
important that one pays extra attention to documentation while coding. Let us assess the documentation done by us in our case study
program and also find out whether our friends also pay similar attention to documentation or not.
Following is a checklist of good documentation points:
Objective of the program is clearly stated in the beginning.
188 Touchpad Computer Science (Ver. 2.0)-XI

