VISHWA BHARATI PUBLIC SCHOOL

CLASS –XI

(PRACTICAL LIST)

Q1. Write a program in C++ to read a line of text from the keyboard & display the following information on the screen :::

(a)  No. of words

(b)  No. of characters

(c)  No. of spaces

Your output should be like this, after clearing the screen

TEXT ENTERED IS = ______

NO. OF WORDS = ______

NO. OF CHARACTERS = ______

NO. OF SPACES = ______

Q2. Write a program in C++ to read a line of text from the keyboard & display the following information on the screen :::

(a)  No. of vowels

(b)  No. of uppercase & lowercase letters seprately

Your output should be like this, after clearing the screen

TEXT ENTERED IS = ______

NO. OF VOWELS= ______

NO. OF UPPERCASE LETTERS = _____

NO. OF LOWERCASE LETTERS = _____

Q3. Write a program in C++ to read your first name & second name and do the following:

(a)  Create a string(name) of your full name by joining first name & second name.

(b)  To copy the string name to another variable say full_name.

Q4. Write a progran in C++ to read a string and perform

(a)  Reverse the string

(b)  Check if the string entered is a Pallindrome or not

Also display the output after reversing the string and message as “GIVEN STRING IS A PALLINDROME”

Or

“GIVEN STRING IS NOT A PALLINDROME WORD”

Q5. Write a program in C++ to read a string of maximum 50 characters & convert the string to uppercase & print the total no. of occurences of all alphabetical characters appearing in the string.

Q6. Write a program in C++ to enter the temp. for the month of june in an array & print the max. , min. , & average temperature of Delhi in june in the format given below:

MONTH : JUNE

Max. temp. Min. Temp. Average

______

Q7. Write a program in C++ to enter the codes of 10 employees & find if any employee with code E-007 works in the organization. If yes then what is his position In the array.

Q8. Write a program in C++ to enter the total no. of students present in a class in the month February & determine what is the max. attendance of the class in that particular month. The format to display the output is :

MONTH : FEBRUARY CLASS : XI

DAY ATTENDANCE

1  ------

2  ------

3  ------

: :

28  -----

TOTAL ATTENDANCE = ------

MAX ATTENDANCE = ------

DAY ON WHICH ATTENDANCE IS MAXIMUM = ------

Q9. Write a program in C++ to enter the marks of class XI-A in an array and of XI-B in another

array . Determine the highest marks in both the sections . Assume that the strength of each section is 25.

Your output should be like :

CLASS HIGHEST MARKS

XI-A ……

XI-B ……

Q10 Write a program to read a matrix MAT of size 3x4 .uncover and Display

1)  Sum of all odd elements

2)  Sum of all even elements

Q11 Write a program to read two matrices A [mXn] and B [pXq]. Calculate and create a third matrics R by adding elements of A and B .Also check for the condition whether matrics A and B are compatible for addition or not. If not then display the message

“ ADDITION OF MATRICES OF DIFFERENT ORDERS IS NOT POSSIBLE”

else Dislay the resultant matrices R in matrics form .

for example : 1 2 3

R = 4 5 6

7 8 9

Q12 Write a program to read a matrics N[mxn] .Read the order of the matrics that is the value of m & n from the user .Create a matrix B[nxm] by taking the transpose of matrix n. Display the orignal matrix n & transposed matrix B as

- - -

N [mxn] - - -

- - -

TRANSPOSE MATRIX B[NXM] IS :

- - -

B[NXM] - - -

- - -

Q13. Read an integer N (the last term) & value for x .Find & display

(1)  sum of the series

1 + x2/2! + x4/4! + …………. + xn/n!

(2)  Print multiplication table of number N in the format given below

N*1 = ---

N*2 = ---

: :

n*10 = ---

Q14 Read the value of n & find the sum of the following series :

1 + (1+2) + (1+2+3)+………. upto n terms

Q14. Read the value for n & find sum of the following series :

1 + (1+2) + (1+2+3) + (1+2+3+4) + ………..upto n terrm

22 + 42 + 62 + 82 + …………………………upto n terms

Q15. Write a program in C++ that calculates the total telephone charges for two months duration on the conditions :

Total telephone charges = Rental + Call charges

Rental charges are Rs. 350 for 2 months

Call charges are as follows:::::

(a)  First 150 calls are free

(b)  If calls are between 151 to 500 ,each call costs 80 paisa.

(c)  If calls are between 501 to 1000 ,each call costs Rs. 1.

(d)  If calls are between 1001 to 2000 , each call costs Rs 1.25.

(e)  Above 2000, each call costs Rs. 1.40.

Q16 Write a program in C++ to display the following output for a given no. of lines. If the no. of

line is 5 the output will be :

A

A B

A B C

A B C D

A B C D E
Q17. Write a program in C++ to display the following output for a given no. of lines. If the no. of line is 5 the output will be :

1

1 2 1

1 2 3 2 1

1 2 3 4 3 2 1

1 2 3 4 5 4 3 2 1

Q18. Write a program in C++ to accept monthly salary from the user . Find & display income tax with the help of following rules ::

MONTHLY SALARY INCOME TAX

9000 OR MORE 40% OF MONTHLY SALARY

7500 – 8999 30& OF MONTHLY SALARY

7499 OR LESS 20% OF MONTHLY SALARY

Q19. Write a funcion ISPRIME( ) in C++ to check if the number n is prime or not . It returns one if the no. is prime otherwise zero.Display the proper output message saying

“THE GIVEN NO. IS PRIME”

or

“THE GIVEN NO. IS NOT PRIME” Also write the main ( ) function.

Q20. Write a menu driven program to perform the conversions using two functions BIN_TO_DEC( ) AND DEC_TO_BIN( ) .Display the menu as

MENU

1.  DECIMAL TO BINARY

2.  BINARY TO DECIMAL

Q21 Write a Program using functions SUM( ) and REVERSE ( ) to find

(a)  Sum of the digits of a number

(b)  Reverse a number

Your program should have main ( ) function. Read the no. through keyboard in main fun

Q22. Write a program in C++ to search a number using Binary search by using a function binary() which takes two arguments the array and the number to be searched and returns 1 if number is found , and 0 if number is not found. Array should contain the names of the n students.

Q24 Write a program to display the following 2-D operations

1.  Display upperhalf of the matrix

2.  Display Lower-half of the matrix

3.  Display the Diagonal sum

4.  Display the row sum

5.  Display the coloumn sum

Q25 Read Marks of 20 students from the user and arrange the numbers in sequence depending upon user’s choice . Choice may be ascending or descending. Display the marks of 1st topper & 2nd topper of the class .

Tricky Problems:

Q26 Write a C++ program to develop the musical keyboard.

Q27 Write a C++ program to convert the Natural numbers into Roman numbers .Your program should take the any number as input and display its Roman equivalent .Take care of invalid inputs and display appropriate error messages.

Q28 Write a C++ program to take a line of text and then sort the each word of the text e.g.

Input : This is a computer class

Output: hist is a cemoprtu aclss

Q29 Write a C++ program to take a line of text and then display the frequency of each character in the following format e.g.

Input : This is a computer class

*

*

* * * * *

* * * * * * * * * * * * *

a c e h i l m o p r s t u

Q30 Write a C++ program to show the graph of projectile motion of a object.or the path of the bouncing ball.

Some more to practice………

1.  Write a program to convert the temperature into Feharanite.

2.  Write a program to print the mathematical table from 1 to 10.

3.  Write a C++ Program to take a value from the user and print the square of it until it is more than 20.

4.  Write a program using for loop to print out the character set from A-Z.

5. Write a Program to find the sum of the series :

(i)  1 + 1/1!+1/2!…………………………..1/n!

(ii)  1 + (1+2) + (1+2+3) +………………………………(1+2+3….+n)

6. Write a program to check whether the number is prime or not.

7. Write a Program to enter the marks in 3 subjects and calculate total and assign grade if total >=200 grade is 'A' otherwise grade is 'B'.

8. Write a program to find maximum and minimum of n numbers.

9. Write a program to find number of vowels, consonants , digits and other characters in a given string.

10. Write a Program which accepts any character values into a two dimensional array of having five different names with 20 characters each and display them.

11. Write a Program to calculate the factorial of given number.

12. Write a Program to print fibonacci series.

13. Write a program to print the sum of diagonal of matrix.

14. Write a program to check whether the given string is palindrome or not.

15. Write a program to perform the following string operations:

a)  Concatenate the two strings.

b)  Copy one string into other.

c)  Compare the two strings. ( Without using string functions.)

**************************