ST.
JOSEPH’S CONVENT HIGH SCHOOL
(CBSE)CHITTARANJAN
SESSION:-2024-25
INFORMATICS PRACTICES ([Link]:-O65)
CLASS-XI
PRACTICAL ASSIGNMENT FILE
NAME: ________________________
CLASS: SECTION
ROLL NO:-
Sl No CLASS XI -INFORMATICS PRACTICES(065) DATE SIGN.
Write a program to read a number n and print n2, n3 and n4.
1
Write a short program that asks for your height in cm and then converts your height to
2
feet and inches. (1 foot = 12 inches, 1 inch = 2.54 cm).
3 Write a program to compute simple interest and compound interest.
4 Write a program to compute roots of quadratic equation.
5
6 Write a program to compute √[ × ( – a) × (s – b) × (s – c)]. s = (a + b + c)/2
7 Write a Python program to sum the sequence: 1 + 1/1! + 1/2! + 1/3! +....... + 1/n! (Input n)
Write programs using nested loops to produce the following patterns:
0
22
8 444
6666
88888
Write a Python script to input temperature. Then ask them what units, Celsius or
9 Fahrenheit, the temperature is in. Your program should convert the temperature to the
other unit. The conversions are: F = 9/5C + 32 and C = 5/9 (F 32).
10 Write a program to shows the any 5 functions of list.
11 Write a program to increment the elements of a list with a number.
12 Write a program that reverses a list of integers (in place).
Write a program to search for an element in a given list of numbers and count frequency
13
of a given element
Write a program to compare two equal sized lists and print the first index where they
14
differ.
Write a program to display the maximum and minimum values from the specified range
15
of indexes of list.
16 Write a program to shows the any 5 functions of Dictionary.
Write a program to enter names of employees and their salaries as input and store them in a
17 dictionary.
Can you store the details of 10 students in a dictionary at the same time ? Details include -
18 rollno, name, marks, grade etc. Give example to support your answer.
Write a program to convert a number entered by the user into its corresponding number in
19 words. For example, if the input is 876 then the output should be 'Eight Seven Six'.
(Hint. use dictionary for keys 0-9 and their values as equivalent words.)
Write a program to Repeatedly ask the user to enter a team name and how many games
20 the team has won and how many they lost. Store this information in a dictionary where
the keys are the team names and the values are lists of the form [wins, losses].
************************************
PRG1:- Write a program to read a number n and print n2, n3 and n4.
SOURCE CODE:-
n = int(input("Enter n: "))
n2, n3, n4 = n ** 2, n ** 3, n ** 4
print("n =", n)
print("n^2 =", n2)
print("n^3 =", n3)
print("n^4 =", n4)
output
PRG2:- Write a short program that asks for your height in cm and then converts your height to feet and inches. (1 foot = 12
inches, 1 inch = 2.54 cm).
SOURCE CODE:-
ht = int(input("Enter your height in centimeters: "))
htInInch = ht / 2.54;
feet = htInInch // 12;
inch = htInInch % 12;
print("Your height is", feet, "feet and", inch, "inches")
OUTPUT :-
PRG3:- Write a program to compute simple interest and compound interest.
SOURCE CODE:-
p = float(input("Enter principal: "))
r = float(input("Enter rate: "))
t = int(input("Enter time: "))
si = (p * r * t) / 100
ci = p * ((1 + (r / 100 ))** t) - p
print("Simple interest = ", si)
print("Compound interest = ", ci)
PRG4:- Write a program to compute roots of quadratic equation.
SOURCE CODE:-
print("Equation: ax^2 + bx + c ")
a=int(input("Enter a: "))
b=int(input("Enter b: "))
c=int(input("Enter c: "))
d=b**2-4*a*c
d1=d**0.5
if(d<0):
print("The roots are imaginary. ")
else:
r1=(-b+d1)/2*a
r2=(-b-d1)/2*a
print("The first root: ",round(r1,2))
print("The second root: ",round(r2,2))
OUTPUT
PRG5:-
SOURCE CODE:-
x = int(input("Enter x: "))
y = int(input("Enter y: "))
z = int(input("Enter z: "))
res = 4 * x ** 4 + 3 * y ** 3 + 9 * z + 6
print("Result =", res)
OUTPUT:-
PRG6:- Write a program to compute √[ × ( – a) × (s – b) × (s – c)]. s = (a + b + c)/2
SOURCE CODE
# Three sides of the triangle is a, b and c:
a = float(input('Enter first side: '))
b = float(input('Enter second side: '))
c = float(input('Enter third side: '))
# calculate the semi-perimeter
s = (a + b + c) / 2
# calculate the area
area = (s*(s-a)*(s-b)*(s-c)) ** 0.5
print("Area of Triangle:-",area)
OUTPUT
PRG7:- Write a Python program to sum the sequence: 1 + 1/1! + 1/2! + 1/3! + + 1/n! (Input n)
SOURCE CODE:-
n = int(input("Enter the value of n: "))
sum = 0
for i in range(n + 1) :
fact = 1
for j in range(1, i) :
fact *= j
term = 1 / fact
sum += term
print("Sum =", sum)
OUTPUT:-
PRG8:- Write programs using nested loops to produce the following patterns:
0
22
444
6666
88888
SOURCE CODE:-
for i in range(0, 10, 2):
for j in range(0, i + 1, 2) :
print(i, end = ' ')
print()
OUTPUT:-
PRG9:- Write a Python script to input temperature. Then ask them what units, Celsius or Fahrenheit, the temperature is
in. Your program should convert the temperature to the
other unit. The conversions are: F = 9/5C + 32 and C = 5/9 (F 32).
SOURCE CODE:-
temp = float(input("Enter Temperature: "))
unit = input("Enter unit('C' for Celsius or 'F' for Fahrenheit): ")
if unit == 'C' or unit == 'c' :
newTemp = 9 / 5 * temp + 32
print("Temperature in Fahrenheit =", newTemp)
elif unit == 'F' or unit == 'f' :
newTemp = 5 / 9 * (temp - 32)
print("Temperature in Celsius =", newTemp)
else :
print("Unknown unit", unit)
OUTPUT
INFORMATICS PRACTICES ([Link]:-065)
CLASS-XI MYSQL PRACTICAL LIST
INDEX PAGE
1) WriteSQLquerytocreateadatabaseEmployee.
2) WriteSQLquerytoopendatabaseEmployee.
3) WriteSQLquerytocreatefollowingTablenameempl.
4) WriteSQLquerytoshowthestructureoftable.
5) WriteSQLquerytoInsert10recordssameasitisinimage.
6) WriteSQLquerytodisplayalltherecordsfromtableempl.
7) WriteSQLquerytodisplayEmpNoandENameofallemployeesfromthetableempl.
8) WriteSQLquerytodisplayEname,Sal,andSaladdedwithcommfromtableempl.
9) WriteSQLquerytodisplayEname,Sal,anddeptnowhoarenotgettingcommissionfromtableempl.
10) WriteSQLquerytodisplayEno,Ename,Sal,andSal*12asAnnualSalarywhosecommissionisnotNU
LLfromtable
11) WriteSQLquerytodisplaythedetailsofemployeeswhosenamehaveonlyfourletters.
12) WriteSQLquerytodisplayname,jobtitleandsalaryofemployeewhodonothavemanager.
13) SQLq h wh “A” h letter.
14) [Link](
DISTINCT).
15) WriteSQLquerytodisplaythenameandsalaryofthoseemployeeswhosesalaryisbetween35000and4
0000.(BETWEEN)
16) WriteSQLquerytodisplaytablesdataaccordingtoascendingorderofsal.
17) WriteSQLquerytochangeENameMITAbyMIRA.
18) WriteSQLquerytodeleterecordswhosedeptno=10.
19) WriteSQLquerytoaddanewcolumnPhno.
20) Write SQL query to delete entire table IF EXISTING.
******************
TEACHER’SSIGNATURE
Section-B ( MYSQL )
1. Write SQL query to create and show a database Employee.
2. Write SQL query to open database Employee.
3. Write SQL query to create following Table name empl.
create table empl(empnoint(4), ename char(20),job char(10), mgrint(4), hiredate date,
salint(4), commint(3), deptnoint(2));
4. Write SQL query to show the structure of table.
5. Write SQL query to Insert 10 records same as it is in image.
Write Insert Query for 10times.
6. Write SQL query to display all the records from table empl.
Ans:select * from empl;
7. Write SQL query to display EmpNo and ENameof all employees from the table empl.
Ans: select EmpNo, EName from empl;
8. Write SQL query to display Ename, Sal, and Sal added with comm from table empl.
Ans: select ename,sal,sal+comm from empl;
9. Write SQL query to display Ename, Sal, and deptno who are not getting commission from table
Ans:-select ename,sal,deptno from empl where comm IS NULL;
10. Write SQL query to display Eno, Ename ,Sal, and Sal*12 as Annual Salary whose commission is not
NULL from table empl.
Ans:-select empno,ename,sal,sal*12 "Annal Salary" from empl where comm IS NOT NULL;
11. Display the details of employees whosename have only four letters.
A * wh EN k “ _______‟;
12. Display name,job title and salary of employee who do not have manager.
Ans:selectEName,job,sal from empl where mgr=NULL;
1 .D h wh “A” h .
A EN wh EN k “_ _ _A%”
14. Display the name of departments. Each department should be displayed once.
Ans:SELECT DISTINCT(Dept) FROM EMPLOYEE;
[Link] the details of all employee whose annual salary is between 25000 to 40000.
Ans: select * from empl where sal between 25000 and 40000;
16. Write SQL query to display tables data according to ascending order of sal.
Ans: select * from empl order by salasc;
17. Write SQL query to change EName MITA by MIRA.
Ans:- update empl set ename="MIRA" where ename="MITA";
18. Write SQL query to delete records whose comm=0.
Ans:- delete from empl where comm=0;
19. Write SQL query to add a new column Phno.
Ans:- alter table empl add phnoint(10);
20. Write SQL query to delete entire table IF EXISTING.
Ans:- drop table IF EXIST empl;
***********************