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();
}