XII C COMPUTER SCIENCE (JUNE 2014 MONTHLY TEST)

KENDRIYA  VIDYALAYA NO. 1  ,  NAUSENABAUGH , VSKP-05
XII C   COMPUTER SCIENCE  (JUNE 2014 MONTHLY TEST)
Time Allowed  : 90 Minutes                                  Max Marks : 40
Note : All questions are compulsory.
  1. What is the need of defining a MACRO using #define directive. Explain with suitable   example.          2M
2.    What is the function overloading? Explain with suitable   example.                                                             2M
       3.    Write the names of the header files to which the following belong:                                                           2M                           (i) stew()          (ii)randomized ()            iii) exp( )               iv) isalnum( )
       4. Rewrite the following program after removing the syntactical errors (if any). Underline each correction. 3M
include <iostream.h>
struct Pixels
{    int Color,Style;}
void ShowPoint(Pixels P)
{    cout<<P.Color,P.Style<<endl;}
void main()
{
     Pixels Point1=(5,3);
     ShowPoint(Point1);
Pixels Point2=Point1;
     Color.Point1+=2;
ShowPoint(Point2);}
      5.   Find the output of the following program:                                                                               3M   
                         #include<iostream.h>
                        #include<ctype.h>
                        void main( )                             {
                                     char Mystring[ ] = "what@ANIDea!";
                                                for(int I=0; Mystring [I] ! = '\0' ; I++)
                                                { if(!isalpha (Mystring[I]) )
                                                                         Mystring[I ]= ' * ';
                                                            else if(isupper (Mystring[I] ))
                                                                        Mystring[I] = Mystring[I]+1;
                                                            else
                                                                        Mystring[I]  = Mystring[I+1]; }
cout<<Mystring;     
                                     }   
     6. Answer the questions (i) to (iv) based on the following:                                               4M      
    class CUSTOMER
{
     int Cust_no;
     char Cust_Name[20];
protected:
void Register();
public:
     CUSTOMER();
     void Status();
};
class SALESMAN
{    int Salesman_no;
     char Salesman_Name[20];
protected:
     float Salary;
public:
     SALESMAN();
     void Enter();
     void Show();
};

class SHOP : private CUSTOMER , public SALESMAN
{
     char Voucher_No[10];
     char Sales_Date[8];
public:
     SHOP();
     void Sales_Entry();
     void Sales_Detail();
 };
(i)     Write the names of data members which are accessible from objects belonging to class CUSTOMER.
(ii)   Write the names of all the member functions which are accessible from objects belonging to class SALESMAN.
(iii) Write the names of all the members which are accessible from member functions of class SHOP.
(iv)  How many bytes will be required by an object belonging to class SHOP?

    7.     Answer the questions (i) to (iv) based on the following code:                                                   4M                          
         class engineering
        {
           private:        
                        char streamcode[5];
            protected:
                        int seats;
                        void allot();

            public:
                         engineering();
                          void streamread();
                           void streamwrite();
           };
          class dept : protected engineering
           {
                   char deptname[20];
                   int strength;
            public:
                        dept();
                       void deptread();
                        void deptwrite();
            };
            class course: public dept
            {
                        char coursename[20];                        float fees;
            public:
                        course();
                        void courseread();
                        void coursewrite();};
(i)                 Which type of inheritance is shown in the above example?
(ii)               How many bytes will be required by an object of the class dept and course?
(iii)             Write the name of all the data members accessible from member functions of the class course.
(iv)              Write the members which are accessible from the object of the class dept.
8. An array A[40][10] is stored in the memory along the column with each element occupying 4 bytes. Find out the Base address and address of the element A[3][6] if the element A[30][10] is stored at the address 9000.         .    .                                                                                                                                                                                  4M
9. Given two dimensional array A[10][20], base address of A being 100 and width of each element is 4 bytes, find the location of A[8][15] when the array is stored as     (a) column wise       (b) Row wise.                     4M

10.An array P[20][30] is stored in the memory along the column with each of the element occupying 4 bytes, find out the memory location for the element P[5][15], if an element P[2][20] is stored at the memory location 5000        …                                                                                                                                                                                4M
11.Define a class Travel in C++ with the description given below:                                                                        4M
Private members:
plancode of type long
place of type  characters array
number_of_travellers of type integer
number_of_buses of type integer
Public members:
A constructor to assign initial values of plancode as 1001, place as “Kolkata”, number_of_travellers as 5 and number_of_buses as 1
A function newplan( ) which allows user to enter plancode , place and number_of_travellers and also assign the number_of_buses as per the following conditions:
number_of_travellers                                   number_of_buses
less than 20                                                     2
equal to and more than 20 and less than 40 3
equal to and more than 40                             4
A function show( ) to display the contents of all the data members on the screen.
12. Define a class named DRAMA in C++ with the following description                                                      4M         
Private members
SHOW_NO                                integer
NAME_OF_THE_DRAMA        Array of characters (String)
DAY                                       integer (Total number of days the same drama is shown)
DAILY_COLLECTION            float
TOTAL_COLLECTION          float
Public Members
input_data  :        A user defined function  to read an object of ENTRY type
print_data :          A function  to display the details of an object
update_data:      A  function  to update the total collection and daily collection once the day
         changes.  Total collection will be incremented by daily collection and daily 
          collection is made     Zero

Popular posts from this blog

XII- CS-- SOLVED SQL queries (SQL PRACTICAL ASSIGNMENS)

SQL--HOME ASSIGNMENTS(XII Class)

Python-MySQL Connectivity