Informatics Practices 2012 CBSE [ Outside Delhi] Set I

To Access the full content, Please Purchase

  • Q1

    a) What social impact does e-Governance have on society? 
    b) Write two important features of e-Business. Give two most commonly used e-Business sites.   
    c)  Mr. Anurag Das working as Manager in Vivian enterprises wants to create a form in NetBeans to take various inputs from user. Choose appropriate controls from Label, TextBox, Radio Button, Checkbox, Listbox, Combobox, & Command button and write them in the third column:

    SNo.

    Control Used to

    Control

    1

    Enter name, Address and salary

     

    2

    Select Gender(Male/Female)

     

    3

    Select Department from available list

     

    4

    Choose Hobby of Employee (Singing/Dancing/Skating/swimming)

     

     

                                                                                                                                             








                                      [1+2+2 =5]

    Marks:5
    Answer:

    (a) The Societal Impacts of E-Governance on society are:

    (i) E-Governance programs have improved the efficiency of administration and service delivery.

    (ii) The E-Governance programs resulted in increased transparency and increased accountancy of government offices.

    (b) The two main features of E-Business are:
    (i) The E-Business refers to any form of transaction that uses an electronic medium to facilitate the transaction.
    (ii) The E-Business provides servicing customers, collaborating with business partners, conducting e-learning and conducting electronic transactions within an organization.

    Two most commonly used e-Business sites are:

    (i) IRCTC Portal: Indian Railways Catering and Tourism Corporation

    www.irctc.co.in

    (ii) Various Banks such as State Bank of India

    www.statebankofinda.com

    (c) The place of the various controls is mentioned
    below:

    SNo.

    Control Used to

    Control

    1

    Enter name, Address and salary

    Text Box

    2

    Select Gender(Male/Female)

    Radio Buttons

    3

    Select Department from available list

    ComboBox, ListBox

    4

    Choose Hobby of Employee (Singing/dancing/Skating/swimming)

    ListBox,

    CheckBox

     

     

     

     

     

     

     

     

    View Answer
  • Q2

    a) Raj Kamal International School is planning to connect all computers, each spread over distance within 45 meter. Suggest an economical cable type having high-speed data transfer, which can be used to connect these computers. 
    b) Name two Indian Scripts included in UNICODE.  
    c) Write examples of one Proprietary and one Open Source Software. 
    d) Name any two most popularly used internet browsers.  
    e) Ms. Rani Sen, General Manager of Global Nations Corporate recently discovered that the communication between her company’s accounts office and HR office is extremely slow and signals drop quite frequently. These offices are 125 meters away from each other and connected by an Ethernet cable. 
    i.Suggest her a device, which can be installed in between offices for smooth communication.
    ii.  What type of network is formed by having this kind of connectivity out of LAN, MAN and WAN? 
    f) Give an advantage of using Star topology over Bus topology. Show a network layout of Star topology to connect 5 computers.  
    g) Give suitable example of URL and Domain name.  
                             [1+1+1+1+2+2+2 = 10] 

    Marks:10
    Answer:

    (a) The optical fiber can be used to connect the computers which are spread within the distance of 45meters. 
    The optical fibers are used for fast transmission of data in the form of light signals over a long distance. They have much greater bandwidth than the other cables. 
    (b) Gurumukhi and Devanagri are examples of two Indian Scripts included in Unicode.
    (c) Proprietary software: Proprietary software refers to any computer software that has restrictions on any combinations of the usage, modification or distributing modified versions of the software. Microsoft Windows, Adobe Flash Player, iTunes are examples of proprietary software. 
    Open Source Software: These are the software whose source code is available to the user for their use and/or modification from its original design is free of charge. These softwares can be freely used and redistributed.
    Tomcat is an example of Open Source software. 
    (d) Google Chrome and Internet Explorer are the two most commonly used internet browsers.
    (e) 
    (i) Repeater is a device used to regenerate the data and voice signal over a long distance. Repeater reads the data packets and amplifies the signals before sending them to the destination node due to which speed of the data transmission increases. Hence, we can install repeaters in-between the offices for smooth communication of data.
    (ii)  The LAN (Local area network) can be selected to design network within a small range of 1km. A local-area network (LAN) is a computer network that spans a relatively small area such as a single building or within an organization which is spread within 1km. 
    f)  The Star topology gives much faster performance as compared to Bus topology, because all computers are attached to a single central point called a hub or a switch. 
    Network layout of Star topology to connect 5 computers:

    g)  Uniform Resource Locators are the address used to locate the files.  
    Examples of URLs are:
    URLs- www.yahoo.com, www.google.com etc
    Domain name specified the type of domain.
    Examples of Domain name are:
    Domain Names - .com, .gov, .edu etc

    View Answer
  • Q3

    a) While making a form in Netbeans, Mr. Harihar  Jha wants to display a list of countries to allow the users to select their own country. Suggest him to choose most appropriate control out of ListBox and ComboBox.  
    b)What is the purpose of break keyword while using Switch Case Statement? Illustrate with the help of an example.
    c)Write the name of HTML tag used to include numbered list in an HTML Web Page.       
    d)  Write HTML code for the following:
    To provide hyperlink to a website 
    “http://www.cbse.nic.in” 
                       
    e)  What will be the content of the jTextArea1 after executing the following code(assuming that the jTextArea1 had no content before executing this code)?         
     for(int C=1; C=4; C++)
           {
    jTextArea1.setText(jTextArea1.getText() + “ ” +    
    Integer.toString(C*C));
                } 
    f) Which of the following units measures the speed with which data can be transmitted from one node to another node of a network? Also give the expansion of the suggested unit. 
    (i)KMph
    (ii)KMpl
    (iii)Mbps
    g) Write Java code that takes value for a number(n) in jTextfield1 and cube(n*n*n) of it to be displayed in jTextField2. 
                                     [1+1+1+1+2+2+2 =10]

    Marks:10
    Answer:

    (a) The ComboBox is the most suitable control to show list of counties, because it takes less space while design a form. At the time of execution we can click on the down arrow of the ComboBox to select the country.

    (b
    ) The Break statement is used to break the loop of switch statement at the end of each case blocks. Due to which each case block gets executed only once during a condition check.

      switch(choice)

    {

    case 1: //statements

                  break;

    case 2: //statements

                  break;

    .

    .

    }

    Here for each value of choice, only one block of case will execute and then as break will encounter, the control would be transferred at the end of the switch block.

    (c) The HTML tag < ol > (ordered list) is used to insert a numbered list in a web page:

    Example Code:

             < b>My Ordered List:< /b >

             < ol >

                < li > Red

                < li > Green

               < li > Blue

               < /ol >

     

    Output:

     

    My Ordered List:

    1.     Red

    2.     Green

    3.     Blue

     

    (d) The HTML code to hyperlink CBSE website is:

      < a href=”http://www.cbse.nic.in/” >Welcome to CBSE< /a>

    (e) The loop will go infinite and it will print : 16 16 16 16 16 16...  as output because the condition check is missing in the body of the for loop.

    (f)The unit (iii) Mbps (Mega bits per second) is used to measure the speed of data transmission from one node to another.

    The data is transferred in the form of bits or bytes. The data transfer rate of a device is often expressed in kilobits or megabits per second, abbreviated as Kbps and Mbps respectively.

    (g) Program to calculate cube of an entered number:

    private void jButton2ActionPerformed( java.awt.event.ActionEvent evt)

    {

                System.exit(0);

    }

     

        private void jButton1ActionPerformed( java.awt.event.ActionEvent evt)

     {

            int a;

            String res;

            a=Integer.parseInt(jTextField1.getText());

            res=String.valueOf(a*a*a);

            jTextField2.setText(res);

        }

    View Answer
  • Q4

    a) Write MySql command to open an existing database. 
     
      

    b) Ms. Mirana wants to remove the entire content of a table “BACKUP” along with its structure to release the storage space. What MySql statement should she use?  
    c) Give one difference between ROLLBACK and COMMIT commands used in MySql. 

    d) A table STUDENT has 4 rows and 2 columns and  another table TEACHER has 3 rows and 4 columns. How many rows and columns will be  there if we obtain the Cartesian product of these two tables?

    e) Mr. Sanghi created two tables with CITY as Primary Key in Table1 and Foreign Key in Table2. While inserting a row in Table2, Mr. Sanghi is not able to enter a value in the column CITY. What could be the possible reason for it? 

    f) Item code consisting of 5 digits is stored in an integer type variable intItemCode. Mr. Srikant wants to store this Item code in a String type variable called strItemCode.
    Write appropriate Java Statement(s) to help her in performing the same.

    g) Mr. Janak is using a table with following columns:
          
    Name, Class, Course_Id, Course_name
    He needs to display names of students, who have not been assigned any stream or have been assigned Course_name that ends with “economics”.
    He wrote the following command, which did not give the desired result.
    SELECT Name, Class FROM Students WHERE
    course_name = NULL OR Course_name = “%economics”;

                                                           [1+1+1+1+2+2+2=10]

    Marks:10
    Answer:

    (a)

    The command to view all existing databases in MySql is:
    show databases;
    Command to used an existing database is:
     use database_name;

    (b) The command used to remove entire content of a table Backup along with table structure is:

       DROP TABLE table_name;

    (c) The difference between COMMIT and ROLLBACK command is that, using COMMIT command the steps of transactions carried out successfully are saved permanently. Whereas using ROLLBACK the steps of transactions failed during processing are undone and the database returns to the same state as it was before this transaction execution stated.

    (d) The Cartesian product of STUDENT table and TEACHER table will result in 12 rows and 6 columns.

    (e) The CITY of table2 is assign a foreign key constraints which prevents the invalid data from being inserted into the foreign key column, because it has to be one of the values contained in the table it points to.

    Any value which is inserted into a foreign key column must be equal to some value in the corresponding parent key of the parent table. So, we can say that Mr. Sanghi must have entered an invalid value in the column CITY due to which he is not able to insert the value into column CITY.

    (f)

    int intItemCode=23444;

    // to assign the value of intItemCode to strItemCode we can write the following code:
         
        String strItemCode = Integer.toString(intItemCode);

     

    OR

       String strItemCode = String.valueOf(intItemCode);

     

    (g) In the code the LIKE keyword is missing which is used to work on string values, due to which Mr. Janak was not able to get the correct output.

    The corrected code is given below:

    Select Name from STUDENTS

    where Course_name = Null OR Course_name LIKE  ‘%ecomomics’ ;

    View Answer
  • Q5

    a) What is the purpose of ORDER BY clause in
    MySql? How is it different from GROUP BY clause?
     

    b) Table SCHOOL has 4 rows and 5 columns. What is
    the Cardinality and Degree of this table?

    c) Consider the table SHOPPE given below. Write command in MySql for (i) to (iv) and output for (v) to (vii)

    Table: SHOPPE

     

    Code

    Item

    Company

    Qty

    City

    Price

    102

    Biscuit

    Hide & Seek

    100

    Delhi

    10.00

    103

    Jam

    Kissan

    110

    Kolkata

    25.00

    101

    Coffee

    Nestle

    200

    Kolkata

    55.00

    106

    Sauce

    Maggi

    56

    Mumbai

    55.00

    107

    Cake

    Britannia

    72

    Delhi

    10.00

    104

    Maggi

    Nestle

    150

    Mumbai

    10.00

    105

    Chocolate

    Cadbury

    170

    Delhi

    25.00

     
















    (i) To display names of the items whose name starts with ‘C’ in ascending order of Price.

    (ii) To display Code, Item name and City of the products whose quantity is less than 100.

    (iii) To count distinct Company from the table.

    (iv) To insert a new row in the table Shoppe

     ‘110’, ‘Pizza’, ‘Papa Jones’, ‘120’, “Kolkata”, 50.0

    (v) Select Item from Shoppe where Item IN(“Jam”, “Coffee”);

    (vi) Select Count(distinct(City)) from Shoppe;

    (vii) Select MIN(Qty) from Shoppe where City = “Mumbai”;

                       [2+1+1+1+1+1+1+1+1 = 10]

    Marks:10
    Answer:

    (a) The ORDER By clause determines the order of rows in the result table which can be either in ascending or descending.

    Example:

           Select * from Student

           ORDER BY Name Desc;

     

    Whereas the GROUP By clause combines the identical values of a particular field or group of fields. This grouping results into one summary record according to each group.     

    Example:

           SELECT grade, avg(fees) from Student GROUP BY grade;

    To place condition on groups we use HAVING clause instead of WHERE clause. 

     

    (b) Cardinality: The cardinality of a relation is the number of tuples or rows present in a table.

    Therefore, Cardinality of Table SCHOOL will be: 4

    Degree: The degree of a relation is the number of attributes or columns present in a table.

    Therefore, Degree of Table SCHOOL will be: 5

    (c) Queries for question (i) to (iv)

    (i) Select Item from SHOPPE

    where Item LIKE ‘C%’ ORDER BY Item;

    (ii) Select Code, Item, City from SHOPPE

    where Qty<100;

    (iii) Select count(DISTINCT Company) “Distinct Company”

    from SHOPPE;
    (iv)  Insert into SHOPPE

    values(‘110’,’Pizza’,’Papa Jones’,120,’Kolkata’,50.0);

    Outputs for question (v) to (vi)

    View Answer
  • Q6

    a) Write MySql command to create the Table STOCK including its Constraints.

    Table: STOCK

    Name of the Column

    Type

    Size

    Constraint

    Id

    Decimal

    4

    Primary Key

    Name

    Varchar

    20

     

    Company

    Varchar

    20

     

    Price

    Decimal

    8

    Not Null

     

     

     

     

     

     

     

     




    b) In a Database there are two tables:

    Table ITEM:

    ICode

    Iname

    Price

    101

    Television

    75000

    202

    Computer

    42000

    303

    Refrigerator

    90000

    404

    Washing Machine

    27000

     

     

     

     

     



     

     


    Table BRAND:

    ICode

    Brand

    101

    Sony

    202

    HP

    303

    LG

    404

    IFB

     

     

     

          

     

     

     

     

     


    Write MySql queries for the following:

    (i) To display ICode, IName and corresponding Brand of those Items, whose Price is between 20000 and 45000(both values inclusive).

    (ii) To display ICode, Price and BName, of the item which has IName as “Television”.

    (iii)To increase the price of all the Items by 15%.

     c) Given below is a Table Patient.

    Name

    P_No

    Date_Admin

    Doc_No

    Vimla Jain

    P0001

    2011-10-11

    D201

    Ishita Kohli

    P0012

    2011-10-11

    D506

    Vijay Verma

    P1002

    2011-10-17

    D201

    Vijay Verma

    P1567

    2011-11-22

    D233

          

     

     

     

     

     

     

     

     


    (i) Idnetify Primary key in the table given above.
    (ii) Write MySql query to add a column Department
     with data type varchar and size 30 in the table Patient.

                                                          [2+2+2+2+1+1 = 10]

    Marks:10
    Answer:

    (a)Query to create table STOCK:

    Create table STOCK

     ( Id decimal primary key,

    Name varchar(20),

    Company varchar(20),

    Price decimal Not Null
            );

    (b)
    (i)  Select ITEM.ICode, IName , Brand
    from ITEM, BRAND

    where (ITEM.ICode=BRAND.ICode) AND

     (Price BETWEEN 20000 AND 45000);

    (ii) Select ITEM.ICode, Price , Brand

    from ITEM, BRAND

    where ITEM.IName = ’ Television’;

    (iii) Update ITEM

    SET Price Price=Price + (Price*0.15);

    (c)

    (i) The Primary Key is assigned to P_No.

    (ii) The query is :
     

    ALTER TABLE Patient

    ADD Department varchar(30);

    View Answer
  • Q7

    a) What message will be displayed after the execution of the following code?

     

    int age=64, Relaxation = 4;

    int ModiAge=Age-Relaxation;

     

    if(ModiAge<60)

    jOptionPane.showMessageDialog(Null, “NOT eligible”);

    else

    jOptionPane.showMessageDialog(Null, “Eligible”);

     

    b) Rewrite the following program code using an If statement:

           int C=jComboBox1.getSelectedIndex();

           switch(C)

          {

              case 0 : Amount=Bill; break;

              case 1 : Amount= 0.9*Bill; break;

              case 2 : Amount= 0.8*Bill; break;

              default : Amount=Bill;

            }

    c) How many times does the following while loop get  executed? 

             int K=5;

             int L=36;

             while(K<=L)

             {

                        K+=6;
    }

    d) What will be displayed in jTextArea1 after executing the following statement?

        jtextArea1, setText(“GREAT\nCOUNTRY\tINDIA”);

    e) What will be the values of variable ‘P’ and ‘Q’ after the execution of the following code?

               int P,Q=0;

               for(P=1; P<=4;P++)

               {

                          Q+=P;

                          Q--;

               }

    f) Given a string object named Salary having value
    as “68000” stored in it. Obtain the output of the following:

    JOptionPane.showMessageDialog(null,” ” + Salary.length() + Integer.parseInt(Salary));

    g) Janav Raj is a programmer at Path Educo Enterprises. He created the following GUI in NetBeans. Help him to write code for the
    following:
     

    (i) To display series of odd or even numbers(depending on Starting Number – jTextField1 is even or odd) in the jTextArea on the click of command button[Display the Series].  

    For example:

    If the Start Number is 5 and Last Number is 11

    Text Area content will be

     

    If the Start Number is 2 and the Last Number is 10

    Text Area Content will be

     

    (ii) To clear both the text fields and text area, on clicking [Reset] button.

    (iii) To terminate the application on the click of [Stop] button. (Assume Suitable names for the various controls on the Form).

                           

                            [2+2+1+1+2+2+2+2+1 = 15]

    Marks:15
    Answer:

    (a) The following message would be displayed after executing the code:
              
    (b)
    The code using if statement is given below:

              int C=jComboBox1.getSelectedIndex();

              if(C==0)

                     Amount=Bill;

              if(C==1)

                     Amount=0.9*Bill;

              if(C==2)

                     Amount=0.8*Bill;

              else

                     Amount=Bill;

    (c) The while loop is executed 6 times.

    (d) The following output would be shown in the JTextArea after executing that code: 
                                    

     (e)  The value of P will be: 4
    The value of Q would be: 6

    (f) The Output will be:
                                    

    In the ouput the first digit indicates the length of value stored in the integer variable.

    (g) The form is:
                                                        

    (i) Code to print series of EVEN or ODD number is:

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)

    {                                        

            int a,b,even,odd;

            a=Integer.parseInt(jTextField1.getText());

            b=Integer.parseInt(jTextField2.getText());

           

            jTextArea1.setText(" ");

            if((a%2==0)&&(b%2==0)||(a%2!=0)&&(b%2!=0))

            {

                for(int i=a;i<=b;i+=2)

                {

                  String str= jTextArea1.getText();   

                    jTextArea1.setText(str + " " +i);

                }

            }

            else

                 JOptionPane.showMessageDialog(this, " Both the ranges should be either EVEN or ODD");

        }                                       

     

    (ii) Code to clear the content of jTextFields and jTextArea.

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt)

    {                                        

            jTextField1.setText(" ");

            jTextField2.setText(" ");

            jTextArea1.setText(" ");

      } 

    (iii) Code to terminate the application

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt)

    {                                        

        System.exit(0);

    }                                       

     

    View Answer