Tuesday, 28 August 2018

11-C Prg15. Write a flow chart and program to print Fibonacci series i.e.0 1 1 2 3 5 8…… using while loop with function


def fib(x):
    f1=0
    f2=1
    print(f1)
    print(f2)
    #logic
    i=3
    while(i<=x):
        f3=f1+f2
        print(f3)
        f1=f2
        f2=f3
        i=i+1

#main program
x=int(input("Enter the number of terms"))
print("The number of terms: ",x)
fib(x)

Example

Enter the number of terms7
The number of terms:  7
0
1
1
2
3
5
8

11-C Prg-19. Write a algorithm and program to find simple interest and compound interest using function.


def s_i(p,r,t):    #called function
    S_I=(p*r*t)/100
    print("Simple Interest=",S_I)
   
def c_i(p,r,t):    #called function
    C_I=p*((1+r/100)**t)
    print("Compound interest=",C_I)

#main program
p=float(input("Enter p value"))
r=float(input("Enter r value"))
t=float(input("Enter t value"))
s_i(p,r,t)  #calling function
c_i(p,r,t)  #calling function

Example:
Enter p value1000
Enter r value2
Enter t value5
Simple Interest= 100.0
Compound interest= 1104.0808032

Monday, 20 August 2018

12. Write a algorithm and program to calculate the area of rectangle, circle, triangle depending upon the user’s choice using if else if with with function

#circle function
def cir_a():
    print("Finding Circle Area:")
    r=float(input("enter the radius:"))
    print("the radius is:",r)
    ca=3.14*r*r
    print("the area of circle is:",ca)

#rectangle function
def rec_a():
    print("Finding Rectangle Area:")
    b=float(input("enter the breadth"))
    l=float(input("enter the length"))
    print("the length and breadth are:",b,l)
    ra=l*b
    print("the area of rectangle is:",ra)

#tariangle function
def tra_a():
    print("Finding Traingle Area ")
    b=float(input("enter the base"))
    h=float(input("enter the height"))
    print("The base and height are:",b, h)
    ta=0.5*b*h
    print("The area of traingle is:",ta)
   
   
#main progarm
print("1.Circle, 2. Rectangle 3. Triangle:")
choice=int(input("enter the choice:"))
print("choice is:",choice)
if choice==1:
    cir_a()
else:
    if choice==2:
        rec_a()
    else:
        if choice==3:
            tra_a()
        else:
            print("wrong choice: choose 1 or 2 or 3 ")

Examples:
   
1.Circle, 2. Rectangle 3. Traingle:
enter the choice:1
choice is: 1
Finding Circle Area:
enter the radius:3
the radius is: 3.0
the area of circle is: 28.259999999999998

1.Circle, 2. Rectangle 3. Traingle:
enter the choice:2
choice is: 2
Finding Rectangle Area:
enter the breadth3
enter the length6
the length and breadth are: 3.0 6.0
the area of rectangle is: 18.0

1.Circle, 2. Rectangle 3. Traingle:
enter the choice:3
choice is: 3
Finding Traingle Area
enter the base3
enter the height7
The base and height are: 3.0 7.0
The area of traingle is: 10.5

1.Circle, 2. Rectangle 3. Traingle:
enter the choice:6
choice is: 6
wrong choice: choose 1 or 2 or 3 

Sunday, 19 August 2018

# prog-14 Write a flow chart and program to calculate factorial of an integer using for loop with function.



Algorithm:
Input:
1. n

Output:
1. fact

Method:
1.start
2.read n
3.write n
4.def fact(n) #calling function
5.stop

#called function before the main program
def fact(n)
    f=1
    for i in range(1,n+1,1)
     begin
      f=f*i
     end
    write"The factorial of given number is:",f

#program
def fact(n):
    f=1
    for i in range(1,n+1,1):
        f=f*i
    print("The factorial of given number is:",f)

#main program
n=int(input("Enter n number"))
print("n=",n)
fact(n)

Example:
Enter n number 4
n= 4
The factorial of given number is: 24

11-C Program - 13

# program 13
def prim(x):
    l=0
    for y in range(2,x,1):
        r=x%y
        if r==0:
            l=1
            break
   
    if l==1:
        print("The given number x is not a prime")
    else:
        print("The given number x is a prime")

#main program 
x= int(input("Enter the number"))
print("x value=",x)
prim(x)

Thursday, 9 August 2018

List of Practicals for class XI-C 2019-20

                                          

1.  Write a program to print the statement-“Getting Started with python”.

2.  Write a program to read the value of two numbers and find their sum.  click here

3.  Write a program to read time in hours, time in minutes, time in seconds and print time in seconds click Here.

4.  Write a program to read marks obtained in five subjects and give the percentage of marks.

5.  Write a program to read the radius of a circle and print the area and circumference of the circle.

6. Write a algorithm and program to read the value of a variable of a quadratic equation and find the discriminant and give the root of the quadratic equation. Click Here

7. Write a algorithm and program to input number of week days (1-7) and translate to its equivalent name of the week. (1 to Monday, 2 to Tuesday……7 to Sunday): click Here

8.Write a algorithm and program to sort 3 numbers without using conditional and looping statements: Click Here

9. Write a program to find absolute value for integer, real and complex numbersClick Here
                                                   
10. Write a algorithm and program to read a number and print the number of digits and the sum of the digits. using function with while loop : Click Here 

11 Write a flow chart and program to calculate factorial of an integer using for loop with function. Click Here

12. Write Algorithm and Python program to print all the numbers divisible by 3 an
and 5 for a given number : click Here

13. Write a algorithm and program to calculate simple interest and compound interest for x number of persons using looping with user defined function: Click Here 

14. Write a algorithm and program to check whether a given number is palindrome or not using function with while loop.Click Here

    Write a flow chart and program to print Fibonacci series i.e.0 1 1 2 3 5 8…… using while loop with function Click Here

15. Write a algorithm and python function program to find minimum and maximum in a list using built in function min() and max() : click Here

16. Write a algorithm and python function program to find minimum and maximum in a list without using built in function min() and max() through looping : Click Here

17. Write a algorithm and python function program to find mean value in a list using function average(): Click Here

18. . Write a algorithm and python function program to find mean value in a list without using function average(): Click Here

19. Write a algorithm and python function program to search an a element in the  list(linear search).Click Here

20. Write a algorithm and python function program to search an a element in the  tuple(linear search): Click Here

21 Write a algorithm and python programming counting the frequency of elements in a list using a dictionary Click Here


22 Write a algorithm and python program accessing elements in a list(array) one by one if element even no. multiply by 10 and odd numbers divide by 5. Click Here

23 Write a algorithm and python program accesses the elements one by one from the list if it is prime number display it. Click Here

Sorting Algorithms

24. Write a algorithm and python program sorting the elements using Bubble sort method through function: Click Here

25. Write a algorithm and python program sorting the elements using Insertion sort method through function: Click Here

26. Write a algorithm and python program Counting the number of operation while sorting the elements through function(bubble sort and insertion sort): Click Here

String

27. Write a algorithm and python program for traversing string using for, range function and slice operator: Click Here

28. Write a algorithm and python program compare strings: Click Here

Introduction to Python Modules

29. Write a algorithm and python program to implementing math module( import math- sqrt, ceil, floor, pow,  fabs, sin, cos, tan ) Click Here

30. Write a algorithm and python program to implementing random module(import random- random, randint and randrange) :Click Here

31. Write a algorithm and python program to implementing statistics module(import statistics- mean, median and mode): Click Here

RDBMS and  SQL(with mysql)- single table onle

1. RDBMS Notes:Click Here
2. SQL Programming: Click Here














15.   Write a algorithm and program to calculate the area of rectangle, circle, triangle depending upon the user’s choice using if else if with with function Click here

16.   Write a flowchart and program check whether the number is prime or not using for loop with function. Click Here



16. Write a algorithm and program to find the sum of series s=1+x+x2+x3………….xn? using for loop with function: Click Here

17.   Write a flow chart and program using nested loops to produce the following designs using for loop with function. Click Here
A)
*
**
***
****
*****
18 Write a algorithm and program to find a given number is Angstrom or not using function.
 Click Here

19. Write a algorithm and program to find simple interest and compound interest using function. Click Here
                                       


        






SQL Programs: Click Here  ( 02 Programs) 



Tuesday, 7 August 2018

11th C Prg-11 Write an algorithm and program to check whether a given number is palindrome or not (using function and without using function)

Algorithm
Input
1. n
Output
1. Palindrome or not
Method:
1. Start
2. Read n
3. Write n
4. n1=n;
5. rev=0;
6.  // logic
  while (n != 0)

  beng
      r= n % 10;
      rev = rev * 10 + r;
      n = n / 10;
  end
7. if (n1 == rev)
    write " the given number is palidrome ";
    else
    write " The given number is not palindrome";
8.stop

Example:
1. 121 is a plindrome
2. 256 is not a palindrome

#program 11

#function

def sum(n):   #called function

    s=0

    n1=n

    rev=0

    while(n>0):

        r=n%10

        rev=rev*10+r

        n=n//10

        s=s+r

    if rev==n1:

        print("The given number is palindrome")

    else:

        print("The given number is not palindrome")

        

   

#main program

n=int(input("Enter the number"))

print("The number is=",n)

sum(n)     #calling functin


Output
Enter the number125
The number is= 125
The given number is not palindrome

Enter the number121
The number is= 121
The given number is palindrome

 

11-C Program-10. Write a program to read a number and print the number of digits and the sum of the digits using function.


   Algorithm:
   Input
   1. n   # n=125
   Output:
   1. s  # s= 1+2+5=8  sum the digits
   Method
   def sum(n)  # called function
   1. s=0
   2.  while(n > 0)
         begin
           r=n%10
           n=n//10   # floor division operato
           s= s+r
         end
   3.  print s
 
   # main program 
   1. start
   2. read n
   3. write n
   4. sum(n)  # function calling
   5. stop
 

#program
#function
def sum(n):   #called function
    s=0
    while(n>0):
        r=n%10
        n=n//10
        s=s+r
    print("Sum of digits=",s)

#main program
n=int(input("Enter the number"))
print("The number is=",n)
sum(n)     #calling functin

Example:
Enter the number125
The number is= 125
Sum of digits= 8

   

Prog-18- Linked Queue Insertion and Deletion Program

 #include<iostream.h>

#include<process.h>
struct Node
{int inf;
Node*next;
}
*front, *newptr,*save,*ptr,*rear;
Node *Create_New_Node(int);
void Insert(Node*);
void Display(Node*);
void DelNode_Q();
int main()
{ front=rear=NULL;
int inf;
char ch='y';
while(ch=='y'||ch=='y')
{
cout<<"enter informtion for the new node...";
cin>>inf;
newptr=Create_New_Node(inf);
if(newptr==NULL)
{ cout<<"\n Cannot create new noe!! Aborting!!\n ";
  exit(1);
}
Insert(newptr);
cout<<"\n press Y to enter more nodes,Nto exit...\n";
cin>>ch;
}//while end
do
{ cout<<"\n The linked -queue now is ( front ...to..rear):\n ";
  Display(front);
  cout<<"want to delete first noe?(y/n)...";
  cin>>ch;
  if(ch=='y'||ch=='Y')
  DelNode_Q();
} while (ch=='y'||ch=='Y');
  return 0;
}//main en
  Node *Create_New_Node(int n)
  { ptr=new Node;
  ptr->inf=n;
  ptr->next=NULL;
  return ptr;
  }
  void Insert(Node *np)
  {
     if(front==NULL)
       {front=rear=np;}
     else
       {rear->next=np;
       rear=np;}
  }
  void DelNode_Q()
  {
   if ( front==NULL)
    cout<<"UNDERFLOW!!\n";
   else
   {ptr=front;
    front=front->next;
    delete ptr;
   }
  }
  void Display(Node*np)
  {
    while(np!=NULL)
     { cout<<np->inf<<" ";
       np=np->next;
     }
    cout<<"!!\n";
  }

Prog-17 Stack Linked list Pushing and Poping

 #include<iostream.h>

#include<conio.h>

#include<stdlib.h>

#include<process.h>

struct Node

{

   int info;

   Node *next;

} *top,*newptr,*save,*ptr;

Node *Create_New_Node(int );

void push(Node *);

void display(Node *);

void pop();

int main()

{

   clrscr();

   top=NULL; //in the begining linked stack is empy, thus pointers are NULL

   int inf;  char ch='y';

   while(ch=='y'||ch=='Y')

   {

     cout<<"\n Enter information for the new node....";

     cin>>inf;

     newptr=Create_New_Node(inf);

     if(newptr==NULL)

     {

    cout<<"\n cannot create new node \n";

    exit(1);

     }

     push(newptr);

     cout<<"\n Press y to enter more nodes, N to exit()....";

     cin>>ch;

   }// while end.

   do

   {

     cout<<"\n The stack now is : \n";

     display(top);

     cout<<"want to pop an element ? (y/n)";

     cin>>ch;

     if(ch=='y'||ch=='Y')

     pop();

    }

    while(ch=='y'||ch=='Y');

    return 0;

  }//main end


  Node *Create_New_Node(int n)

  {

    ptr= new Node;

    ptr->info=n;

    ptr->next=NULL;

    return ptr;

  }

  void push(Node *np)

  {

    if(top == NULL) top=np;

    else

    {  save =top; top=np;

       np->next=save;

    }

  }

  void pop()

  {

    if(top==NULL) cout<<"Underflow";

    else

    {

      ptr=top; top=top->next;

      delete ptr;

     }

  }

  void display(Node *np)

  {

    while(np != NULL)

    {

      cout<<np->info<<"->";

      np=np->next;

    }

    cout<<" !!! \n";

  }

August monthly Test Blue-print 2018


                                                 Question No.3 (unit-3)   Data structure in C++ - 14 marks

      Paper question with Answer

     a) Two Dimensional Address Calculation( Row major / Column major)-3 marks

     b) One Dimensional static allocation writing function only(application level) - 2 marks

     c) Two Dimensional static allocation writing function only(application level) - 3 marks
    
     d)  Dynamic allocation writing function only(Stack / Queue( Insertion and Deletion) - 4 marks
                         1. LQ-Ins                     2. LQ-Del                 3. LS-Ins                   4. LS-Del

     e) Infix to postfix conversion  /  postfix evaluation through stack                  - 2 marks

Test Paper :  Answer