Thursday 23 April 2015

CBSE Class 12 - Computer Science (C++) Questions on Class Design

Computer Science (C++) - Class Design

Questions Asked in Board Papers on Class Design

Q1(CBSE 2013):  Define a class Tourist in C++ with the following specifications:
     Data Members:
  • CarNo - to store bus number
  • Origin - to store Place name
  • Destination - to store Place name
  • Type - to store Car Type such as 'E' for Economy
  • Distance - to store the Distance in Kilometers
  • Charge - to store the Car Fare
    Member Functions:
  • A constructor function to initialize Type as 'E' and Freight as 250
  • A function CalcCharge( ) to calculate Fare as per the following criteria:
    Type Charge
    'E' 16*Distance
    'A' 22*Distance
    'L' 30*Distance

  • A function Enter( ) to allow user to enter values for CarNo, Origin, Destination, Type and Distance. Also this function should call CalcCharge( ) to calculate Fare.
  • A function Show( ) to display the content of all the data members on screen.
 Answer:
 const int BUFFSIZE = 40;
 class Tourist
 {
   // private data members
   int carNum;
   char origin[BUFFSIZE];
   char destination[BUFFSIZE];
   char carType;
   int distance;
   int charges;
  public:
    // member functions
    // constructor
   Tourist()
    {
     carType = 'E';
     charges = 250;
    }

   // calculate charges
   void CalcCharges()
    {
     if (Type == 'E')
     {
      charges = 16*distance;
     }
    else if (Type == 'A')
     {
      charges = 22*distance;
     }
    else if (Type == 'C')
     {
      charges = 30*distance;
     }
 };

 // enter values
 void Tourist::Enter()
 {
   cout << "Enter CarNo, Origin, Destination, Type, Distance:";
   cin >> carNum;
   gets(origin);
   gets(destination);
   cin >> carType >> Distance;
   CalcCharges();
 }
 
 // show/display details
 void Show()
 {
   cout << "Car No: " << carNum 
        << "\nOrigin: " << origing 
        << "\nDestination: " << destination
        << "\nType: " << carType
        << "\nDistance: " << distance
        << "\nCharges: " << charges << endl; 
 }
 };

Q2(CBSE 2012): Define a class Flat in C++ with the following description:
     Private Members:

Saturday 18 April 2015

CBSE Class 10 - Maths - CH2 - Polynomials - Study Points

Polynomials

CBSE Class 10 - Maths - CH2 - Polynomials - Study Points


Study Points

1. An expression of the form a0 + a1x + a2x2 + ----- + anxn where an is called a polynomial in variable x of degree n. where; a0 ,a1, ----- an are real numbers and are called terms/co-efficients of the polynomial and each power of x is a non negative integer.

2. Polynomials in the variable x are denoted by f(x), g(x), h(x) etc.
    e.g. f(x) = a0 + a1x + a2x2 + ----- + anxn

3. A polynomial p(x) = a (where a is constant) is of degree 0 and is called a constant polynomial.

4. A polynomial p(x) = ax + b is of degree 1 and is called a linear polynomial. e.g. 4x - 3, 5x...

5. A polynomial p(x) = ax2 + bx + c of degree 2 and is called a quadratic polynomial.
    e.g. 3x2 -x + 5, 1- x2...

6. A polynomial p(x) = ax3 + bx2 + cx + d of degree 3 and is called a cubic polynomial.
    e.g. √5x3 - 2x2 + 5x -1...

Saturday 4 April 2015

CBSE Class 12 - Computer Science - Sample Question Paper - (2014-15)

Class 12
Computer Science
Sample Q Paper (2014-15)



CLASS-XII
COMPUTER SCIENCE
(Subject Code 083)
SAMPLE PAPER 2014 - 15

Time allowed : 3 hours
Maximum Marks: 70

Instructions:
(i) All questions are compulsory.
(ii) Programming Language: Section A C+ +.
(iii) Programming Language : Section B Python.
(iv) Answer either Section A or B, and Section C is compulsory.

Section A (C++)

Q1 (a) Differentiate between ordinary function and member functions in C++. Explain with an example. [2]
(b) Write the related library function name based upon the given information in C++.
(i) Get single character using keyboard. This function is available in stdio.h file.
(ii) To check whether given character is alpha numeric character or not. This function is available in ctype.h file.
[1]
(c) Rewrite the following C++ program after removing all the syntactical errors (if any), underlining each correction. :
include <iostream.h>
#define PI=3.14
void main( )
{ float r;a;
  cout<<’enter any radius’;
  cin>>r;
  a=PI*pow(r,2);
  cout<< ”Area=” << a
}
[2]
(d) Write the output from the following C++ program code:
#include <iostream.h>
#include <ctype.h>
void strcon(char s[])
{
  for(int i=0,l=0;s[i]!='\0';i++,l++);
  for(int j=0; j<l; j++)
  {
    if (isupper(s[j]))
      s[j]=tolower(s[j])+2;
    else if ( islower(s[j]))
      s[j]=toupper(s[j])-2;
    else
      s[j]='@';
  }
}

void main()
{
  char *c="Romeo Joliet";
  strcon(c);
  cout<<"Text= "<<c<<endl;
  c=c+3;
  cout<<"New Text= "<<c<<endl;
  c=c+5-2;
  cout<<"last Text= "<<c
}
[2]
(e) Find the output of the following C++ program:
#include<iostream.h>
#include<conio.h>
#include<ctype.h>
class Class
{
  int Cno,total;
  char section;
 public:
  Class(int no=1)
  {
   Cno=no;
   section='A';
   total=30;
  }
  void addmission(int c=20)
  {
   section++;
   total+=c;
  }
  void ClassShow()
  {
   cout<<Cno<<":"<<section<<":"<<total<<endl;
  }
};

void main()
{
  Class C1(5),C2;
  C1.addmission(25);
  C1.ClassShow();
  C2.addmission();
  C1.addmission(30);
  C2.ClassShow();
  C1.ClassShow();
}   

Wednesday 1 April 2015

CBSE Class 9 - Maths - Number Systems (Very Short Questions and Answers)

NUMBER SYSTEMS 

Very Short Q & A

Q1: Categorize the following numbers as
(i) Natural Numbers
(ii) Whole Numbers
(iii) Integers
(iv) Rational Numbers
7, 3/2, 0, 2, -9/5, 1/4, -8

Answer:
(i) Natural Numbers {2, 7}
(ii) Whole Numbers {0, 2, 7}
(iii) Integers {-8, 0, 2, 7} 
(iv) Rational Numbers {-8, -9/5, 0, 1/4, 3/2, 2, 7}

Q2: What is the rational number which does not have reciprocal?

Answer: 0 (zero)


Q3: Write the greatest negative integer.

Answer: -1

Q4: Name the smallest natural number.

Sunday 29 March 2015

CBSE Class 10 - Maths - CH1 - Real Numbers (Euclid's Division Lemma)

Euclid's Division Lemma

Important Questions asked in Examination...
Euclid (4th BC)
credits: wikipedia

Q1: State Euclid's Division Lemma.

Answer: Given positive integers a and b ( b ≠ 0 ), there exists unique integer numbers q and r satisfying a = bq + r, 0 ≤ r < |b|. where
    a is called dividend
    b is called divisor
    q is called quotient
    r is called remainder.

    e.g. 17 = 5 × 3 + 2

Q2: Prove Euclid's Division Lemma.

Answer: According to Euclid's Division lemma, for a positive pair of integers there exists unique integers q and r, such that
                      a = bq + r, where 0 ≤ r < b

Let us assume q and r are not unique i.e. let there exist another pair q0 and r0 i.e. a = bq0 + r0, where 0 ≤ r0 < b

⇒ bq + r = bq0 + r0
⇒ b(q - q0) = r - r0                                          ................ (I)

Since 0 ≤ r < b and 0 ≤ r0 < b, thus 0 ≤ r - r0 < b ......... (II)

The above eq (I) tells that b divides (r - r0) and (r - r0) is an integer less than b. This means (r - r0) must be 0.
⇒ r - r0 = 0 ⇒ r = r0

Eq (I) will be, b(q - q0) = 0
Since b ≠ 0, ⇒ (q - q0) = 0 ⇒ q = q0

Since r = r0 and q = q0, ∴ q and r are unique.

Q3: Prove that the product of two consecutive positive integers is divisible by 2?

Saturday 17 January 2015

CBSE Class 9 - CH 12 - Sound (Study Points)

Sound
Visual Representation of Sound Waveform
(image courtsey: openclipart)

Study Points

1. Sound travels from one point to another in the form of waves.

2. Sound is produced due to vibration of different objects.

3. Sound waves are longitudinal in nature.

4. Sound travels as a longitudinal wave through a material medium.

5. Sound travels as successive compressions and rarefactions in the medium.

6. In sound propagation, it is the energy of the sound that travels and not the particles of the medium.

7. Sound cannot travel in vacuum.

8. Sound waves cannot be polarised.

9. The change in density from one maximum value to the minimum value and again to the maximum value makes one complete oscillation.

10. The part or region of a longitudinal wave in which the density of the particles of the medium is higher than the normal density is known as compression.

11. The part or region of a longitudinal wave in which the density of the particles of the medium is lesser than the normal density is called a rarefaction.

12. The distance between two consecutive compressions or two consecutive rarefactions is called the wavelength, λ.

CBSE Class 12 - Chemistry - Question Paper (2014)

CHEMISTRY (Theory)

CBSE Class 12 - Chemistry - Question Paper (2014)

2014

[Time allowed: 3hrs] [Maximum Marks:70]

General Instructions :
(i)   All questions are compulsory.
(ii)  Questions numbers 1 to 8 are very short-answer questions and carry 1 mark each.
(iii) Questions numbers 9 to 18 are also short-answer questions and carry 2 marks each.
(iv)  Questions numbers 19 to 27 are long-answer questions and carry 3 marks each.
(v)   Questions numbers 28 to 30 are long-answer questions and carry 5 marks each.
(vi)  Use Log Tables,if neccessary.Use of calculators is not allowed.


1. Give one example of sol and gel? 1
2. Which reducing agent is employed to get copper from the leached low grade copper ore? 1
3. Write the IUPAC name of the compound 1
CH3 - CH - CH2 - CHO               
            NH2
4. Which of the following isomers is more volatile : 1
o-nitrophenol or p-nitrophenol ?
5. Some liquids on mixing form 'azeotropes'. What are 'azeotropes' ? 1
6. Arrange the following in increasing order of basic strength : 1
C6H5NH2, C6H5NHCH3, C6H5CH2NH2