0% found this document useful (0 votes)
26 views5 pages

All Assignments - XI

The document contains a series of assignments for XI Computer Science students at Mayoora School Ajmer, covering various topics in programming and computer science. Assignments include conversions between number systems, binary arithmetic, string manipulation, and the use of data structures such as lists, tuples, and dictionaries. Each assignment consists of multiple programming tasks designed to enhance students' coding skills in Python.

Uploaded by

Bajrang Sharma
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)
26 views5 pages

All Assignments - XI

The document contains a series of assignments for XI Computer Science students at Mayoora School Ajmer, covering various topics in programming and computer science. Assignments include conversions between number systems, binary arithmetic, string manipulation, and the use of data structures such as lists, tuples, and dictionaries. Each assignment consists of multiple programming tasks designed to enhance students' coding skills in Python.

Uploaded by

Bajrang Sharma
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/ 5

MAYOOR SCHOOL AJMER

XI Computer Science / Assignment 1


1) Convert the following denary(decimal) to binary:
(a) 13 (b) 1075 (c) 85 (d) 199 (e) 35.567 (f) 166.0754
2) Convert the following binary to denary:
(a) 10001000 (b) 101111 (c) 1110.001 (d) 10000.11001
3) Convert the following denary to octal:
(a) 145 (b) 177 (c) 189 (d) 2450
4) Convert the following octal to denary:
(a) 146 (b) 172 (c) 134 (d) 777
5) Convert the following denary to hexadecimal:
(a) 1488 (b) 197 (c) 2047 (d) 1456
6) Convert the following hexadecimal to denary:
(a) A13B (b) 7CA3 (c) E9 (d) A6
7) Convert the following hexadecimal to binary:
(a) A6 (b) 7AB4 (c) A07 (d) 9BC8
8) Convert the following binary to hexadecimal:
(a) 1001101110001 (b) 101111100 (c) 1111101110 (d) 101111110
9) Convert the following octal to binary:
(a) 7642 (b) 7015 (c) 3576 (d) 3527
10) Convert the following binary to octal:
(a) 100100001 (b) 10111101 (c) 1000100010 (d) 1111111
11) Convert the following hexadecimal to octal:
(a) 38AC (b) ABCD (c) 7FD6

MAYOOR SCHOOL AJMER


XI Computer Science / Assignment 2
1) Add the following binary numbers:
(a) 10111 + 1111 (b) 111 + 111 (c) 1010 + 1110 (d) 11101 + 10111
2) Subtract the following binary numbers:
(a) 10111 - 1111 (b) 10000 - 111 (c) 1010000 - 1110 (d) 1010100 – 10111
3) Determine the one’s complement for the following binary numbers:
(a) 100111 (b) 1100111 (c) 11001110 (d) 100011
4) Determine the two’s complement for the following binary numbers:
(a) 1110111 (b) 1001111 (c) 1001010 (d) 10001111

MAYOOR SCHOOL AJMER


XI Computer Science / Assignment 3
1) WAP to print the table of a given number in this format. ( 5 x 1 = 5 )
2) WAP that accepts student marks in five subjects(out of 100) and prints the percentage marks.
3) WAP that inputs any number and prints cube of that number.
4) WAP that inputs radius of a circle and print area and circumference of a circle.
5) WAP that inputs length and breadth of rectangle and prints Area and Perimeter.
6) WAP that read values of P,Q,R and S and display the value of Z, where Z = P + Q
R–S
7) WAP that reads temperature in Celsius and displays it in Fahrenheit.
8) Evaluate the following expressions:
(a) 12 + 3 * 4 - 6 / 2 (b) (12 + 3) * 4 – 6 / 2 (c) 12 + 3 * (4 – 6) / 2
(d) 12 + (3 ** 4 – 6)/ 2 (e) 12 * (3 % 4)// 2 + 6 (f) 12 % 3 ** 4//5 + 6
MAYOOR SCHOOL AJMER
XI Computer Science / Assignment 4
1) WAP to swap two variable with the help of third variable.
2) WAP to swap two variable without using third variable.
3) WAP to read a number n and print n2, n3, n4, n5.
4) WAP to accept three digits( i.e 0 to 9) and print all possible combinations from these digits.( For
example, if the digits are 1,2 and 3 then combinations are 123, 132, 231, 213, 312 and 321).
5) WAP to accept Principal, Rate and Time from user and compute Simple Interest and Amount.
6) WAP to accept 4 digit number and print the sum of all their digits.( i.e. if number is 1234 then the
sum of their digits will be 1+2+3+4=10).
MAYOOR SCHOOL AJMER
XI Computer Science / Assignment 5
1) WAP to check the number whether it is odd or even.
2) WAP to read 3 numbers from the user and print the bigger number.
3) WAP to read two numbers and an operator ( +,-,*, / ) and print result.
4) WAP to read the age and citizenship from the user and check if age>=18 and citizenship is “Indian”
then print “YOU CAN VOTE” otherwise print “CAN’T VOTE”.
5) WAP to read year and check whether it is leap or not.
6) WAP to ask a number if it is odd then print its square else print its cube.
7) WAP to calculate the area of a Circle, rectangle, a triangle or a Square depending upon the user’s
choice.
8) WAP to ask a single character from the user and check whether it is a vowel or not.
9) WAP to print roots of a quadratic equation.
10) WAP to input number of week’s day (1-7) and translate to its equivalent name of the day of the
week.( e.g. 1 to Sunday, 2 to Monday…….., 7 to Saturday).

MAYOOR SCHOOL AJMER


XI Computer Science / Assignment 6
1) WAP to accept a character between ‘a’ to ‘k’ and display next 4 characters.
2) WAP to input marks of five subjects and calculate the percentage and then assigns grade
accordingly:
Percentage Grade
> = 90 S
> =80 and <90 A
>=70 and <80 B
>=60 and <70 C
>=50 and <60 D
<50 F
3) WAP to input any number and check if it is positive then print its double , if it is negative then print
its cube.
4) WAP to accept Basic Salary and city from the user and calculate Gross salary according to his basic
salary as shown :
Basic >= 10000 DA = 50% of Basic, TA = 10%
8000 <=Basic <10000 DA = 40% of Basic, TA = 10%
5000 <=Basic <8000 DA = 30% of Basic, TA =10%
If city is ‘metro’ then HRA=1000 otherwise HRA = 500.
MAYOOR SCHOOL AJMER
XI Computer Science / Assignment 7
1) WAP to make the following series :
a) Even number series 2 4 6 8 10 ………….n
b) Odd number series 1 3 5 7 9 …………...n
c) Square series 1 4 9 16 25………….n2
d) Even Square series 4 16 36 64 …….. n2
e) Odd square series 1 9 25 49………… n2
f) Fibonacci series 0 1 1 2 3 5 8 13……….n
g) Lucas series 1 3 4 7 11………n
2) WAP to input any integer from user and reverse the number.
3) WAP to count the number of digit in a number.
4) WAP to input any number and display sum of digits.
5) WAP to find out the given number is Palindrome or not.
6) WAP to sum of the series : S = 1 + x + x2 + x3 + x4 + ………..xn

MAYOOR SCHOOL AJMER


XI Computer Science / Assignment 8
Write the python script to draw the following patterns based on loops. Fetch the number of rows from the user
in all the questions.

(a) * * * * * * (b) * (c) 1 (d) 1


****** ** 22 2 3
****** *** 333 4 5 6
****** **** 4444 7 8 9 10
****** ***** 55555 11 12 13 14 15
(e) 1 (f) A (g) A (h) $ $ $ $ $
1 2 BB AB $$$$
1 2 3 CCC ABC $$$
1 2 3 4 DDDD ABCD $$
1 2 3 4 5 E EEEE ABCDE $
(i) $ $ $ $ $ $ (j) @ (k) & & & & & & (l) @
$$$$$ @@ &&&&& @@@
$$$$ @@@ &&&& @@@@@
$$$ @@@@ &&& @@@@@@@
$$ @@@@@ && @@@@@@@@@
$ @@@@@@ &
MAYOOR SCHOOL AJMER
XI Computer Science / Assignment-9
1) WAP to count the number of vowels in a string input by the user.
2) WAP to count the length of a string given by the user.
3) WAP to reverse of a string.
4) WAP to change a given string to a new string where the first and last chars have been exchanged.
5) WAP to input a string and check whether the string is symmetrical or Palindrome.
6) WAP to input a string and a character and print whether the character is contained in the string or not.
Also display how many times the input character coming in the string.
7) WAP to change a given string to a new string where the first and last chars have been exchanged.
8) WAP to add ‘ing’ at the end of a given string (length should be at least 3). If the given string already
ends with ‘ing’ then add ‘ly’ instead. If the string length of the given string is less than 3, leave it
unchanged.
Sample String : ‘abc’ Expected Result : ‘abcing’
Sample String : ‘string’ Expected Result : ‘stringly’
9) WAP that reads a string and converts it to uppercase.
10) WAP that checks whether a given character is an alphabet or not. If it is an alphabet, whether it is lower
case character or uppercase character?
11) WAP that reads three strings (First name, Middle name, Last name) and concatenating all the string.
12) WAP that reads a password and prints “OK” if the correct password is entered, otherwise print
“SORRY”. The user should be given three chances to type the password.
13) WAP that reads two strings and concatenate the smaller string into the bigger string.
14) WAP to display name in consecutive case fetched from the user.
15) WAP to fetch a name from the user in lowercase and store reverse of it in another string in uppercase.

MAYOOR SCHOOL AJMER


XI Computer Science / Assignment 10
1) WAP to accept 5 elements of list and count even and odd number of elements in a list.
2) WAP to accept marks of 5 subject in a list and display the total mark and percentage.
3) WAP to accept a list of 5 elements and print the reverse of it.
4) WAP to accept values of two lists A & B of 5 elements and hence store the sum of list A & B in list C.
5) WAP to find out maximum and minimum element in a list of 5 elements.
6) WAP to count the number of strings where the string length is 2 or more and the first and last character
are same from a given list of strings.
Sample List: ['abc', 'xyz', 'aba', '1221']
Expected Result: 2

7) WAP to fetch a list from the user and remove the duplicates from a list.
8) WAP to declare a list ORIG contains 5 elements and clone or copy it to another list DUPL.
9) WAP to declare a list of 5 elements and display the index of a list along with the element.
10) WAP to find the second smallest number in a list.
11) WAP to find common items from two lists.
12) WAP to generate groups of five consecutive numbers in a list.
13) WAP to fetch a list of five elements and a number then find all the values in a list are greater than a
specified number.
14) WAP to insert a given string at the beginning of all items in a list.
Sample list : L= [1,2,3,4] String : “Mayoor”
Expected output: ['Mayoor1', ‘Mayoor2', 'Mayoor3', ‘Mayoor4']
15) WAP to concatenate all elements of a list.
MAYOOR SCHOOL AJMER
XI Computer Science / Assignment 11

1) WAP to accept 5 elements of list and convert the list to tuple.


2) WAP to create a tuple containing marks of 5 subjects and display the Total Mark and Percentage.
3) WAP to create two tuples A & B of 5 elements and hence store the sum in list C.
4) WAP to find out the difference between maximum and minimum element in a tuple of 5 elements.
5) WAP to create a tuple and count the occurrence of an item fetched from the user in a tuple.
6) WAP to convert a tuple to a single string.
7) WAP to check whether the element fetched from the user exists within a tuple or not.
8) WAP to remove an element fetched from the user from the tuple.
9) WAP to find the index of an item fetched from the user in a tuple.
10) WAP to create a tuple containing Roll number, Name and Mark of student and hence unpack tuple in
several variables.
11) WAP to replace last value of tuples in a list.
Sample list: [(10, 20, 40), (40, 50, 60), (70, 80, 90)]
Expected Output: [(10, 20, 100), (40, 50, 100), (70, 80, 100)]

MAYOOR SCHOOL AJMER


XI Computer Science / Assignment 12
1) WAP to declare two dictionaries and merge two Python dictionaries.
2) WAP to declare a dictionary contains Rollno as key and Marks as values and display the average of all
the marks in a dictionary.
3) WAP to accept a key from the user and remove that item from a dictionary.
4) WAP to create a dictionary containing names of competition winner students as keys and number of
their wins as values.
5) Write a Python script to print a dictionary where the keys are numbers between 1 and 5 (both included)
and the values are square of keys. Sample Dictionary {1: 1, 2: 4, 3: 9, 4: 16, 5: 25}
6) WAP to create a dictionary whose keys are month names and whose values are the number of days in
the corresponding months.
a. Ask the user to enter a month name and use the dictionary to tell how many days are in the
month.
b. Print out all of the keys in alphabetical order.
c. Print out all of the months with 31 days.
7) WAP that checks a value and checks whether the given value is part of given dictionary or not. If it is, it
should print the corresponding key otherwise print an error message.
8) WAP that checks a key and checks whether the given key is part of given dictionary or not. If it is, it
should print the corresponding value otherwise print an error message.
9) WAP that checks if two same values in a dictionary have different keys. That is, for dictionary
D1={‘a’:10,’b’:20,’c’:10}, the program should print “2 keys have same values” and for dictionary
D2={‘a’:10,’b’:20,’c’:30}, the program should print “no keys have same values”.
10) Write a Python script to concatenate following dictionaries to create a new one.
Sample Dictionary:
dic1={1:10, 2:20}
dic2={3:30, 4:40}
dic3={5:50,6:60}
Expected Result : {1: 10, 2: 20, 3: 30, 4: 40, 5: 50, 6: 60}
11) WAP to combine two dictionary adding values for common keys.
d1 = {'a': 100, 'b': 200, 'c':300}
d2 = {'a': 300, 'b': 200, 'd':400}
Sample output: Counter({'a': 400, 'b': 400, 'd': 400, 'c': 300})

You might also like