0% found this document useful (0 votes)
3 views24 pages

Arnab Cs Project

Uploaded by

KILLSHØT
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)
3 views24 pages

Arnab Cs Project

Uploaded by

KILLSHØT
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/ 24

MDH

INTERNATIONAL
SCHOOL

COMPUTER
SCIENCE
PRACTICAL FILE
2024-2025

Name: Arnab Pal


Class: XII-A
Rno: 8
INDEX
Sor$ng list in ascending order
1.
Enter details of student in a text file
2.
3. Conver$ng octal numbers to various other types

Calcula$ng simple interest by using func$ons


4.
Maximum value at index in dic$onary
5.
Sor$ng a list in a different way rather than bubble sort
6.
A func$on that takes amount-in-dollars and dollar-to-rupee conversion price , it
7. then returns the amount converted to rupees
A func$on that receives two numbers and generates a random number from that
8. range. Using this func$on, the main program should be able to print three numbers
randomly
A func'on that receives two numbers and generates a random number from that range.
9. Using this func'on, the main program should be able to print three numbers randomly
A func$on namely nth Root that receives two parameters x and n and returns nth
10. root of x i.e., x^(1/n). The default value of n is 2
A program to count the words "to" and "the" present in a text file "Poem.txt".
11.
A method func$on DISPLAY WORDS () in python to read lines from a text file
12. Poem.txt, and display those words, which are less than 4 characters
A func$on in Python to count and display the number of lines star$ng with
13. alphabet 'A' present in a text file "Poem.txt”
A program that should prompt the user to type some sentence followed by
14. "enter". It should then print the original sentence and the following sta$s$cs
rela$ng to the sentence
15. A program that prompts for a phone number of 10 digits and two dashes, with
dashes aYer the area code and the next three numbers
a program that reads characters from the keyboard one by one. All lower case
16.. characters get stored inside the file lower, all upper case characters get stored
inside the file upper and all other characters get stored inside file others
To enter books details in stack by using push, display and exit func$on
17.
My SQL queries
18.
Ques: Sor5ng list in an ascending order

Code:

Output:
Ques: enter details of a student in a text file

Code:

Output:

Text File:
Ques: conver5ng octal numbers to various other types

Code:

Output:
Ques: Calcula5ng simple interest by using func5ons

Code:

Output:
Ques: Maximum value at index in dic5onary

Code:

Output:
Ques: Sor5ng a list in a different way rather than
bubble sort

Code:

Output:
Ques: A func5on that takes amount-in-dollars and
dollar-to-rupee conversion price; it then returns the
amount converted to rupees

Code:

Output:
Ques: A func5on that receives two numbers and
generates a random number from that range. Using
this func5on, the main program should be able to
print three numbers randomly.

Code:

Output:
Ques: A func5on namely nth Root that receives two
parameters x and n and returns nth root of x i.e.,
x^(1/n). The default value of n is 2

Code:

Output:
Ques: A program to count the words "to" and "the"
present in a text file "Poem.txt".

Code:

Output:

Text file:
Ques: A method func5on DISPLAY WORDS () in python
to read lines from a text file Poem.txt, and display
those words, which are less than 4 characters.

Code:

Output:
Ques: A func5on in Python to count and display the
number of lines star5ng with alphabet 'A' present in a
text file "Poem.txt”

Code:

Output:
Ques: A program that should prompt the user to type
some sentence followed by "enter". It should then
print the original sentence and the following sta5s5cs
rela5ng to the sentence.

Code:

Output:
Ques: A program that prompts for a phone number of
10 digits and two dashes, with dashes aaer the area
code and the next three numbers.

Code:

Output:
Ques: a program that reads characters from the keyboard one by
one. All lower case characters get stored inside the file lower, all
upper case characters get stored inside the file upper and all other
characters get stored inside file others.

Code:

Output:
Text File output:
Ques: To enter books details in stack by using push,
display and exit func5on.

Code:
Output:
MySQL
1: To create the given table and name as stu1 and insert values:

mysql> create table stu1(sno int, name varchar(20), stipend int, stream
varchar(30), avgmarks float(5,2), grade char(1), class varchar(5));
mysql> insert into stu1 values(1, ‘karan’ ,400, ‘medical’, 78.5, ‘B’, ‘12B’);
(adding some more values into this table, let the table be as shown below)
2: To display name and avgmarks in descending order:
mysql> select name, avgmarks from stu1 order by avgmarks desc;

3: To display the minimum, maximum and average marks:


mysql> select min(avgmarks) from stu1;

mysql> select max(avgmarks) from stu1;

mysql>select avg(avgmarks) from stu1;


4: To display name and stipend, also add 10 marks in stipend whose
stipend<300:
mysql>select name, stipend+10 ‘new stipend’ from stu1 where
stipend<400;

5: To count the number of students in each stream:


mysql>select count(name),stream from stu1 group by stream;

6: Pattern matching (like operator):


mysql> select name, stream from stu1 where name like “d%”;
7: To update the a column with given condition:
mysql> update stu1 set grade='C' where sno=4;

8: To update one whole row:


mysql>update stu1 set stipend=stipend+10;

You might also like