Saturday 29 July 2017

11D-Prg5 Write a algorithm and program to read the radius of a circle and print the area and circumference of the circle.


Algorithm
Input
1. r  // radius

Output
1. ar  // area of circle
2. cr  // circumference

Method:
1. start
2. Read r
3. Write r
4. ar=3.14*r*r  // ar=3.14*pow(r,2); //#include<math.>
5. cr=2*3.14*r
6. write r and cr
7. stop

Example:

1. r=2
   ar=3.14*2*2
   ar=12.56

   cr=2*3.14*2
   cr=12.56

Friday 28 July 2017

12C Prgoram-14 Write Program to implement Binary Search


#include<iostream.h>
int bsearch(int[],int,int);
int main()
{int ar[50],item,n,index;
cout<<"enter desired array size...";
cin>>n;
cout<<"\n enter array elements";
for(int i=0;i<n;i++)
cin>>ar[i];
cout<<"\nenter element to be searcherd for...";
cin>>item;
index=bsearch(ar,n,item);
if(index==-1)
cout<<"\nsorry!!given elment could not found.\n";
else
cout<<"\nelement found at index:"<<index<<",position:"<<index+1<<endl;
return 0;
}
int bsearch(int ar[],int size,int item)
{int beg,last,mid;
beg=0;
last=size-1;
while(beg<=last)
{mid=(beg+last)/2;
if(item==ar[mid])return mid;
else if (item>ar[mid])  beg=mid=1;
else last=mid-1;
}return-1;
}

Saturday 22 July 2017

11D- Pract-4.Write Algorithm and programme for read marks obtained in five subjects and give the percentage of marks.


Algorithim

Input

1)P  2)C 3)M 4)CS 5)E
Output
1)Per  //percentage
Method:
1.Start
2.Read P,C,M,CS & E
3.Write P,C,M,CS & E
4.tot=(P+C+M+CS+E);
5.per=tot/5;
6.Write per
7.stop

Friday 21 July 2017

11th August-2017 test Blue-print


40 Marks

Chapter-1 Computer Overview -10 marks

Chapter-2 Software concepts -  08 marks

Chpater-3 Data Representation - 12 marks

Chapter-4 Microprocessor Basics and Memory Concepts- 10 marks



Sunday 16 July 2017

12th class: July-Monthly-Test Pattern-2017-18

Date of Test: 24/07/2017, Monday   Time: 8.30AM to 10.00AM Total Marks:35     Duration: 1Hour 30Minutes

I C++ Revision tour (12+5=17 marks)

1) Direct question - 2+2=4 marks

2)  Header file question - 1+1=2 marks

3)  Syntax Error finding program -2+2=4marks

4) Output finding-1  (function call by value and reference with array) -2marks

5)Output finding-2 (character arrays) - 3 marks

6) Output finding -3 (Random numbers) -2 marks

II Object Oriented Programming - (12+6=18) marks

1)Direct Question-2+2=4 marks

2) Constructor & Destructor-2 marks

3) Class writing  Programme logic  -4marks

4) Inheritance Programme logic problem solving - 4+4=8 marks

Saturday 15 July 2017

/* 11-D Prg2- Write a algorithm and C++ Program to read the value of two numbers and find their sum. */

  /*  11-D Prg2- Write a algorithm and C++ Program
   to read the value of two numbers and find their sum. */

/*Algorithm:

Input
  1. a
  2. b

Output
  1. sum

Method:
   1. start           // int a,b,sum;
   2. Read a and b   // cout<<"Enter a and b\n";   cin>>a>>b;
   3. Write a and b  //cout<<"a="<<a;  cout<<"b="<<b;
   4. //logic for sum
       sum=a+b;       //sum=a+b;
   5. Write sum       //cout<<"sum="<<sum;
   6. stop

Program: */
#include<iostream.h>
#include<conio.h>

void main()
{
 clrscr();
 int a,b,sum;
 cout<<"Enter a and b \n";
 cin>>a>>b;
 cout<<"a="<<a;
 cout<<"\tb="<<b;
 sum=a+b;
 cout<<"\nsum="<<sum;
 getch();
}

Friday 14 July 2017

12-C Prog-3 Define a class Travel Plan

/*12-C Prog-3 Define a class Travel Plan
private:
Tcode int
Tname string
Source string
Destination string
Distance float
Fare int

->Function Calfare() which calculates and returns fare according to following
criteria.

Distance   Fare
<= 1000     500
> 1000 and <=2500        750
>2500 100

public:
->Function ReadData() to read the data members and
  call function Calfare() to calculate fare;
->Function ShowData() to print the values of all the data members.*/

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
class TravelPlan
{
   int Tcode;
   char Tname[20];
   char Source[30];
   char Destination[30];
   float Distance;
   int Fare;

   int calFare();

   public:
   void ReadData();
   void ShowData();
};
int TravelPlan :: calFare()
{
  if(Distance <= 1000)
   return 500;
  else  if(Distance <= 2500)
   return 750;
  else
   return 1000;
}
void TravelPlan :: ReadData()
{
  cout<<"\n Enter Travel code \n";
  cin>>Tcode;
  cout<<"\n Enter Travel Name ";
  gets(Tname);
  cout<<"\n Enter Source\n";
  gets(Source);
  cout<<"\n Enter Destination \n";
  gets(Destination);
  cout<<"\n Enter Distance \n";
  cin>>Distance;
  Fare=calFare();
}
void TravelPlan :: ShowData()
{
  cout<<"\n Travel Code "<<Tcode;
  cout<<"\n Travel Name "<<Tname;
  cout<<"\n Travel source "<<Source;
  cout<<"\n Destination "<<Destination;
  cout<<"\n Distance"<<Distance;
  cout<<"\n Fare"<<Fare;
}

void main()
{
   clrscr();
   TravelPlan T;
   T.ReadData();
   T.ShowData();
   getch();
}




Wednesday 12 July 2017

/* 11-D Prg-1 Write program to print the statement-"Getting started with C++"*/

/* 11-D Prg-1 Write program to print
the statement-"Getting started with
C++"*/
//single line comments prg1

#include<iostream.h>
#include<conio.h>

 main()
{
 clrscr();

 cout<<" Getting started with c++ \n";
 // displaying address
 cout<<"KV Hebbal Bengaluru ";
}

Monday 10 July 2017

/*12-C Prog-2 Define a struct employee to store employee code, employee name, address, phone no., salary. Create 5 objects of employee type read their values and print in ascending order of salary */

/*12-C Prog-2 Define a struct employee to store employee code, employee
name, address, phone no., salary.  Create 5 objects of employee type
read their values and print in ascending order of salary */

#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
#include<stdio.h>


struct employee
{
  int empcode;
  char empname[30];
  char adress[40];
  long phone;
  float salary;
};

void read(employee &E)
{
  cout<<"\n Enter employee code";
  cin>>E.empcode;
  cout<<"\n Enter employee name";
  gets(E.empname);
  cout<<"\n Enter employee's address";
  gets(E.adress);
  cout<<"\n Enter employee's phone no";
  cin>>E.phone;
  cout<<"\n Enter salary";
  cin>>E.salary;
}

void Arrange(employee E[], int size)
{
   int i,j;
   employee T;
   for(i=0;i<size;i++)
   {
     for(j=i+1;j<size;j++)
     {
       if(E[i].salary > E[j].salary)
       {
 T=E[i];
 E[i]=E[j];
 E[j]=T;
       }
     }
   }
}

void print(employee E)
{
  cout<<"\n Employee code"<<E.empcode;
  cout<<"\n Employee Name";
  puts(E.empname);
  cout<<"Employee Adress";
  puts(E.adress);
  cout<<"\n Employee Phone no"<<E.phone;
  cout<<"\n Employee salary"<<E.salary;
}

void main()
{
  clrscr();
  employee emp[5];
  cout<<"\n Enter details of Employee";
  for(int i=0; i<5; i++)
  {
    cout<<"\n Enter details of employee";
    read(emp[i]);
  }
  Arrange(emp,5);
  cout<<"\n Employees according to ascending order of salary\n";

  for(i=0;i<5;i++)
  {
     cout<<"\n Employee"<<i+1;
     print(emp[i]);
  }
 getch();
}

Thursday 6 July 2017

12C-Prg-1-Write a Program to define a class myarray.

12C-Prg-1-Write a Program  to define a class myarray. which reads n elements of int type.  Write
4 member functions
1. input();
2.output();
3.large();  //  largest element logic
4.small(); // smallest element logic

#include<iostream.h>
#include<conio.h>

class myarray
{ int a[50],l,i,n,s;

  public:
  void input();
  void large();
  void small();
  void output();
};
void myarray::input()
{
  cout<<"enter no. of elements=";
  cin>>n;
  cout<<"\nenter the elements";
  for(i=0;i<n;i++)
  cin>>a[i];
}
void myarray::large()
{
  l=a[0];
  for(i=1;i<n;i++)
  { if(l<a[i])
    l=a[i];
  }
}
void myarray::small()
{
  s=a[0];
  for(i=1;i<n;i++)
  { if(s>a[i])
    s=a[i];
  }
}
void myarray::output()
{
 cout<<"\nlargest ="<<l;
 cout<<"\nsmallest="<<s;
}

void main()
{
clrscr();
myarray obj1;
obj1.input();
obj1.large();
obj1.small();
obj1.output();
getch();
}

11-D Practical-03 Algorithm and Program for read time in hours, time in minutes, time in seconds and print time in seconds.


11-D Practical-03 Algorithm for read time in hours, time in minutes, time in seconds and print time in seconds.


Input
1)h 2)m 3)s
output
1)Sec
Method
1.start
2.Read h,m & s   //cin>>h>>m>>s;
3.write h,m & s   // cout<<"h="<<h;
4. H=h*60*60;
   M=m*60;
   S=s;
   Sec=H+M+S;
5.Write Sec; 


 Program
#include<iostream.h>
void main()
{
int h,m,s,H,M,S,Sec;

cout<<"Enter the h,m and s \n";
cin>>h>>m>>s;
cout<<"h="<<h;
cout<<"m="<<m;
cout<<"s="<<s;

H=h*60*60;
M=m*60;
S=s;
Sec=H+M+S;
cout<<"Seconds="<<Sec;
}

List of Practicals for class XI 2017-18

List of Practicals for class XI
1.       Write a program to print the statement-“Getting Started with C++”.
2.       Write a program to read the value of two numbers and find their sum.
3.       Write a program to read time in hours, time in minutes, time in seconds and print time in seconds.
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 program to read a number and print the number of digits and the sum of the digits.
7.       Write a program to read the value of a variable of a quadratic equation and find the discriminant and give the root of the quadratic equation.
8.       Write a 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)
9.       Write a program to check whether a given number is palindrome or not.
10.   Write a program to calculate the area of rectangle, circle, triangle depending upon the user’s choice.
11.   Write a program to check whether the number is prime or not.
12.   Write a program to display a menu regarding rectangle operation and perform according to user response.
13.   Write a program to calculate and print the sum of even integers of the first n natural numbers.
14.   Write a program to calculate and print the sum of odd integers of the first n natural numbers.
15.   Write a program to calculate factorial of an integer.
16.   Write a program to calculate commission for the salesman. The commission is calculated according to the following rates:

SALESMAN COMMISSION RATE COMMISSION
30001 onwards 15%
22001-30000 10%
12001-22000 7%
5000-12000 3%
0-5000 0 %
The program accepts the sales made by the salesman and display the calculated commission.
17.   Write a program to input a character and to print whether a given character is an alphabet, digit or any other character.
18.   Write a program to compute Cosine series i.e.
Cos(x)= 1 – x2/2! + x4/4! – x6/6! + …xn/n!
19.   Write a program to print Fibonacci series i.e.0 1 1 2 3 5 8………
20.   Write a program to find a given number is Angstrom or not.
21.   Write a program using nested loops to produce the following designs:

A)
*
**
***
****
*****
B)
1
12
123
1234
12345
C)
1
23
456
789 10
11 12 13 14

22.   Write a program to find the sum of series s=1+x+x2+x3………….xn?
23.   Write a program to replace every space in a string with a hyphen.
24.   Write a program to find the largest and smallest number out of given list of 10 numbers.
25.   Write a program to find the division of student when percentage and criteria for division is:

PERCENTAGE DIVISION
70-100 Honour
60-69 First
45-59 Second
33-44 Third
Below 33 Fail