42
Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print Type of Questions Marks Per Question Total No of Questions Total Marks SA-I 1 16 16 SA-II 2 18 36 LA 6 3 18 Total 37 70 Topic/ Unit SA (1 mark) SA (2 marks) LA (6 marks) Total Networking and Open Standards 4 (4) 3(6) - 7(10) Programming (Java and HTML) 7 (7) 6 (12) 1(6) 14(25) Relational Database Management System (MySQL) 4(4) 7(14) 2(12) 13(30) IT Applications 1(1) 2(4) - 3(5) Total 16(16) 18(36) 3(18) 37(70) “You have one thing common with successful people – “a 24 hour day ”. It’s how you see it that makes the difference”. All the Best for Board Exam ‘2015Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 1

Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Embed Size (px)

Citation preview

Page 1: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15)

Informatics Practices Class XII

MISSION 2015

Blue Print

Type of Questions Marks Per Question Total No of Questions Total Marks SA-I 1 16 16 SA-II 2 18 36 LA 6 3 18 Total 37 70

Topic/ Unit SA

(1 mark) SA (2 marks)

LA (6 marks)

Total

Networking and Open Standards 4 (4) 3(6) - 7(10) Programming (Java and HTML) 7 (7) 6 (12) 1(6) 14(25) Relational Database Management System (MySQL)

4(4) 7(14) 2(12) 13(30)

IT Applications 1(1) 2(4) - 3(5) Total 16(16) 18(36) 3(18) 37(70)

“You have one thing common with successful people – “a 24 hour day”. It’s how you see it that makes the difference”.

All the Best for Board Exam ‘2015’

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 1

Page 2: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15)

UNIT-1 (Networking and Open Standards)

1. Define a network? Mention its two advantages? 2. Which of the following is not a feature of networking?

(i) Resource sharing (ii) Uninterrupted power supply (iii) Reduced cost (iv) Reliability

3. What are the uses of microwave signals? 4. Which transmission medium is useful for sparsely populated areas? 5. Ram is interested in transferring songs from his mobile to Shyam mobile. Suggest two

suitable wireless options he may use for doing the same. 6. Name the device that connects multiple networks irrespective of their protocols. 7. Define the following:

a) Gateway (b) Bridge (c) Hub (d) Switch (e) Repeater (f) Modem 8. When would you prefer hubs over repeaters? 9. Two neighbourhood schools, at a distance of 120 meters from each other, decide to join

their LANs using UTP cable so that they can share their e-learning resources. But after joining their LANs they are not able to share the resources due to loss of signal in-between. Which device should they use so that signal is amplified in-between? [Ans: Repeater]

10. What is client server computing? Can you give example of a real life situation that uses client server computing?

11. What is the difference between LAN and MAN? 12. What is the difference between LAN and Internet? 13. Two doctors in the same room have connected their Palm Tops using Bluetooth for

working on a Group presentation. Out of the following, what kind of Network they have formed? LAN, MAN, PAN, WAN. [Ans: PAN]

14. What is the purpose of using a MODEM? 15. Which device converts digital signals to analog signals and vice versa. [Ans: Modem] 16. Grijesh is confused about Wi-Fi. Whether it is a

(i) Type of network cable (ii) Set of popular technologies and standards for wireless computer networking. (iii) Set of computer programs that help people log in to the Internet.

17. What is MAC address? 18. What type of address is the following? Also identify its parts.

20: B9: F1: 63: 2F: FB [Ans: MAC address] 19. On a network, this is your computer’s unique hardware number. What is it?

[Ans: MAC address] 20. This is the numbered address (four parts separated by periods) that identifies a website

uniquely. What is it? [Ans: IP address] 21. This is the mechanism that obtains IP address using a URL of a website.

[Ans: Domain Name Resolution] 22. What is IP address? How is it useful in computer security? 23. Sujata says that the following numbers indicate an address:

208. 77. 188. 166 What is the above address called? To which object/device is it assigned? [Ans: IP address. Assigned to devices participating in a network]

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 2

Page 3: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) 24. Jai Khanna is confused between the terms Domain Name and URL. Explain the

difference with the help of appropriate examples of each. 25. What is the unique name given to site that becomes site’s identification on Internet.

[Ans: URL] 26. How is Coaxial cable different from Optical Fiber? 27. Which cable uses light to transmit data instead of magnetic signals? [Ans: Optical Fiber] 28. Write two disadvantages of twisted pair cable? 29. Which communication media would you suggest to be procured by a company for

connecting its local offices in New Delhi for very effective and fast communication? 30. Management of Global village enterprise wants that the LAN segment in each of its

buildings get a dedicated bandwidth. i.e. bandwidth must not be shared. How can this be achieved?

31. Arrange the following communication channels in ascending order of their data transmission rates: Ethernet Cable, Optical Fiber, Telephone Cable, Coaxial Cable. [Ans: Telephone Cable, Ethernet Cable, Coaxial Cable, Optical Fiber]

32. Which transmission medium should be used to transfer data across two continents at very high speed? [Ans: Satellite]

33. Which of the following technologies requires line of sight between the transmitter and receiver? (i) Microwave (ii) Satellite (iii) Twisted Pair Cable (iv) Co-axial Cable

34. What do you understand by firewall? 35. Name these

(i) It is protocol/technology used to exchange files on internet. [Ans: FTP] (ii) It provides a set of rules to transfer files, videos, images over world wide web.

[Ans: HTTP] 36. It is a technology on computer networks whose purpose is to prevent unwanted

networking connection according to some filtering/blocking rules. What is it? [Ans: Firewall]

37. Tara Nathani wants to upload and download files from/to a remote Internet server, write the name of the relevant communication protocol, which will let her do the same. [Ans: FTP]

38. Define any two threats to Network security. 39. What are DoS attacks? How does it affect internet access? 40. A webserver has started receiving endless messages. What is this situation like?

[Ans: ‘Denial of Service’ attack] 41. What do you understand by cyber laws? 42. What is OSS? 43. Which of the following is not a characteristic of OSS?

(i) Its source code is available for modification. (ii) It is owned by a company or an individual. (iii) It can be download from internet.

44. What is free software? How is it different from OSS? 45. How is free software different from freeware? 46. Distinguish between OSS and Proprietary software with reference to customizability of

the software. 47. Navneet is using software, which has been downloaded from internet and is available for

one month. After one month he has to pay license fee for further use. What software Navneet is using?

48. Jayanto Das is confused between Shareware and OSS. Mention at least two points of differences to understand the same.

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 3

Page 4: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) 49. Which protocol is used for the transfer of hypertext documents on the internet?

[Ans: HTTP] 50. What for are these software used?

(a) Linux (b) Mozilla (c) PHP (d) Python (e) Apache (f) MySQL (g) Tomcat 51. Explain the following terms: OSI, FLOSS, FSF, GNU, W3C. 52. What is an open standard? Give some examples. 53. Which of the following standards are proprietary standards and which are open

standards? (a) AIFF (b) ASX (c) RM (d) WMA (e) OGG (f) FLAC (g) JPEG (h) DVI (i) DOC [ Hint: AIFF- Apple Machintosh, ASX, DOC and WMA- Microsoft, RM- Real Media]

54. Name an open standard for the following: (a) Web page [Ans: HTML] (b) Office document [Ans: ODF] (c) Vector images [Ans: SVG] (d) Audio compression [Ans: OGG] (e) Any image type [Ans: PNG] (f) Plain text [Ans: ASCII]

55. Which of the following softwares are Open source. Linux, MS Windows 7, Photoshop, MySQL. [Ans: Linux, MySQL]

56. What do you mean by Static and Dynamic fonts? 57. What are different font categories on the basis of technical specifications?

[Ans: TTF, OTF] 58. In how many different ways can you type Indian script on a computer?

[Ans: Using Phonetic text entry and Keymap based entry] 59. Name two encodings used for Indian language computing. [Ans: Unicode, ISCII] 60. Name any four Indian scripts included in Unicode. [Ans: Bengali, Devnagri, Tamil,

Gujrati, Gurunukhi, Telegu, Kannada, Malayalam] 61. Difference between LAN, MAN and WAN. 62. What is the Geographical scope of LAN, MAN and WAN? 63. Zoom developers wants to link its head office in Delhi to its another office in Japan.

What type of network would formed? [Ans: WAN] 64. Bholu is confused as he is unable to find the name of a network of computers and other

devices that is confined to a relatively small space- an office. Help him do that. [Ans: LAN]

65. An organization is planning to link its sale counter situated in various parts of the same city, which type of network will be formed? [Ans: MAN]

66. Define the following with reference to threats to network security. (i) Worms (ii) Trojan Horse

67. What do you mean by network topology? Give two advantages and disadvantages of following topologies: Bus topology, Star topology, Ring topology.

68. A school would like to go in for network of all the computers. Which topology would you recommend and why?

69. Name the network topology in which there are bi-directional links between each possible node.

70. Which network topology requires terminators at the ends of the lines? 71. The organization is planning to link its head office situated in Delhi with the offices at

Srinagar. Suggest an economic way to connect it; the company is ready to compromise on the speed of connectivity. Justify your answer.

72. Differentiate between uploading & downloading.

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 4

Page 5: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) 73. Identify the types of topology from following:

(i) In it, each node is connected with the help of a single co-axial cable. [Ans: Bus] (ii) In it, each node is connected with the help of independent cable with the help of a

central switching (communication controller). [Ans: Star] (iii) In it the nodes form a circular path for data to travel and each node is connected to

two other nodes. [Ans: Ring] (iv) In it devices are connected through hub and the control, hub is responsible for

receiving and transmitting data from each node to destination. [Ans: Star] (v) Each device with a point-to-point connection to every other device in the network.

[Ans: Mesh] 74. What do following protocols do: HTTP, SMTP, FTP, TCP/IP. 75. Name the protocol used for sending and receiving e-mails. [Ans: SMTP] 76. Most common communication protocol on Internet that ensures end to end

communication, is? [Ans: TCP/IP] 77. What are following ODF file extensions meant for?

(a) odt (b) ods (c) odp (d) odg (e) odb [Ans: Text documents, Spreadsheet files, Electronic presentation files, Graphic files, Database files]

78. What is the significance/role of ARPANET in the computer network? 79. Differentiate between Internet and Intranet. 80. How is bandwidth measured on analog circuits and on digital?

[Ans: On Analog- Baud, On Digital- Bps (Bits per second)] 81. Which of the following unit 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) Mbps (ii) KMph (iii) MGps

82. Which of the following is not a unit for data transfer rate? (i) mbps (ii) kbps (iii) sbps (iv) gbps

83. Which communication medium is to be suggested for very effective and fast communication in guided medium? [Ans: Optical Fiber]

84. What is the purpose of using a Web Browser? Name any two commonly used Web Browser. [Ans: Mozilla Firefox, Internet Explorer, Opera, Google Chrome]

85. Which protocol is used to copy a file from/to a remotely located server? 86. Which protocol lets you log onto a remote machine and run specific applications there? 87. What is the difference between Virus and Worms in the computers? 88. What term do we use for a software/hardware device, which is used to block

unauthorized access while permitting authorized communication? This term is also used for a device or set of devices configured to permit, deny, encrypt, decrypt, or proxy all (in and out) computer traffic between different security domains based upon a set of rules and other criteria. [Ans: Firewall]

89. Mr. Kamal Sengupta wants to prevent unauthorized access to/from his company’s LAN. Write the name of a system (software/hardware), which he should install to do the same. [Ans: Firewall]

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 5

Page 6: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) 1. Knowledge Supplement Organization has set up its new center at Mangalore for its office

and web based activities. It has 4 blocks of buildings as shown in the diagram below: Center to center distances between various blocks

Black A to Block B 50 m Block B to Block C 150 m Block C to Block D 25 m Block A to Block D 170 m Block B to Block D 125 m Block A to Block C 90 m

Number of Computers Black A 25 Block B 50 Block C 125 Block D 10

e1) Suggest a cable layout of connections between the blocks. e2) Suggest the most suitable place (i.e. block) to house the server of this organization

with a suitable reason. e3) Suggest the placement of the following devices with justification

(i) Repeater (ii) Hub/Switch

e4) The organization is planning to link its front office situated in the city in a hilly region where cable connection is not feasible, suggest an economic way to connect it with reasonably high speed?

e5) The organization is planning to connect its International Office situated in Mumbai. Which out of the following wired communication links, will you suggest for a very high speed connectivity?

Telephone Analog Lines Optical Fiber Ethernet Cable

Block A

Block C

Block B

Block D

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 6

Page 7: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) 2. Ravya Industries has set up its new center at Kaka Nagar for its office and web based

activities. The company compound has 4 buildings as shown in the diagram below:

Center to center distances between various buildings is as follows: Harsh Building to Raj Building 50 m Raz Building to Fazz Building 60 m Fazz Building to Jazz Building 25 m Jazz Building to Harsh Building 170 m Harsh Building to Fazz Building 125 m Raj Building to Jazz Building 90 m

Number of Computers in each of the buildings is follows: Harsh Building 15 Raj Building 150 Fazz Building 15 Jazz Bulding 25

e1) Suggest a cable layout of connections between the buildings. e2) Suggest the most suitable place (i.e. building) to house the server of this organisation

with a suitable reason. e3) Suggest the placement of the following devices with justification:

(i) Internet Connecting Device/Modem (ii) Switch

e4) The organisation is planning to link its sale counter situated in various parts of the same city, which type of network out of LAN, MAN or WAN will be formed? Justify your answer. e5) Mention an economic technology to provide internet accessibility to all buildings.

Raj Building

Fazz Building

Harsh Building

Jazz Building

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 7

Page 8: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) 3. "China Middleton Fashion" is planning to expand their network in India, starting with

two cities in India to provide infrastructure for distribution of their product. The company has planned to set up their main office units in Chennai at three different locations and have named their offices as "Production Unit", "Finance Unit" and "Media Unit". The company has its corporate unit in Delhi. Approximate distances between these Units are as follows:

From To Distance

Production Unit Finance Unit 70 Mtr

Production Unit Media Unit 15 KM

Production Unit Corporate Unit 2112 KM

Finance Unit Media Unit 15 KM In continuation of the above, the company experts have planned to install the following number of computers in each of their office units:

Production Unit 150

Finance Unit 35

Media Unit 10

Corporate Unit 30 i. Suggest the kind of network required (out of LAN, MAN, WAN) for connecting each of

the following office units: Production Unit and Media Unit Production Unit and Finance Unit ii. Which one of the following devices will you suggest for connecting all the computers within each of their office units? Switch/Hub, Modem, Telephone iii. Which of the following communication media, will you suggest to be procured by the

company for connecting their local office units in Chennai for very effective (HighSpeed) communication?

Telephone Cable, Optical Fiber, Ethernet Cable iv. Suggest a cable/wiring layout for connecting the company's local office units located in

Chennai. Also, suggest an effective method/technology for connecting the company's local office unit with corporate unit located in Delhi.

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 8

Page 9: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15)

UNIT-2 (Programming Concepts- Java GUI)

90. Give difference between object oriented and event driven programming? 91. What is message? How is it related to an event? 92. How is ordinary compilation process different from Java compilation? 93. What is the difference between an interpreter and a compiler? 94. What are containers? Give examples. 95. Differentiate between a component and a container. 96. What happens to container control and its child controls if you delete

(i) The container control (ii) A child control (iii) All child controls

97. Name two containers for each of the following categories: (i) Top level [Ans: JFrame, JDialog, JApplet] (ii) Middle level [Ans: JPanel, JTabbedPane] (iii) Component level [Ans: JButton, JLabel]

98. What are keywords? Can keywords be used as identifiers? 99. How are keywords different from identifiers? 100. What will be the value of i= --k + 2*k + j++, if k is 20 and j is 10 initially? 101. What will be the value of p= p * ++j, where j is 22 and p=3 initially? 102. Name the eight primitive Java types. 103. To what value is a variable of String type and Boolean type automatically

initialized? [Ans: Default value of a string type is null and Boolean type is false] 104. When creating a new project, we left the “Create Main Class” checkbox

deselected. Why? 105. What is the significance of a null statement? 106. What is casting? When do we need it? 107. What is meant by implicit and explicit type conversion? 108. One out of several different alternatives can be selected with the help of which

statement? [Ans: Selection statement] 109. What are selection statements? Name the selection statements provided by Java? 110. What is the purpose of break statement in a switch statement and in a loop? 111. What is the effect of absence of break in a switch statement? 112. The absence of break statement in cases of switch statement give rise to a

mechanism known as? [Ans: fall through] 113. What is the significance of default clause in a switch statement? 114. How is the if…else if combination more general than a switch statement? 115. What are iteration statements? Name the iteration statements provided by Java? 116. Which elements are needed to control a loop? 117. What is the purpose of break and continue statement in a loop? 118. Explain the difference between entry controlled and exit controlled loop with one

example. 119. Give the name of a ternary operator. 120. What is the default name of action event handler of a button namely TestBtn?

[Ans: TestBtnActionPerformed] 121. What command do you need to write in actionPerformed( ) event handler of a

button, in order to make it exit button? [Ans: System.exit(0); ] 122. Which method mimics the clicking of a button in Java swing? [Ans: doClick( )]

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 9

Page 10: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) 123. What method would you use, in order to simulate a button’s (namely OkBtn) click

event, without any mouse activity from user’s side? [Ans: OkBtn.doClick( ); ] 124. A label by default allows only one line of text to be displayed. Can you display

multiple lines of text in a label? [Ans: Yes, by using HTML text] 125. How would you set a label to have both an image as well as text?

[Ans: Set icon property to path of specific image file and text property to specific text] 126. You have assigned a foreground colour and background colour through

foreground and background properties of a label. But the label is not showing any background colour. What could be the reason? [Ans: Set opaque property of label to True as by default it is false]

127. Write name of class methods to obtain and change text of a label. [Ans: getText( ) and setText( )]

128. What are these methods used for? (i) isEditable( ) (ii) setEditable( ) (iii) getEchoChar( )

129. Write names of String API class used to create text field. [Ans: JTextField] 130. What is the difference between text properties of text field and a text area? 131. What is the difference between a text field and a password field when both can

obtain text from user? 132. What does getPassword( ) on a password field return? [Ans: a character array] 133. How can you make the text of a text field as un-editable text?

[Ans: Set editable property of text field to false] 134. While developing a Java GUI application, Asgar wants to ensure that AmountTF

text field must not be zero or negative. Thus he wants to write a code that will display an error message if so happens. Which event handler should he write his code into? [Ans: FocusLost event handler as well as Action event handler of AmountTF]

135. Which event gets fired when a check box is clicked? [Ans: Item Event] 136. What is the name of event listener interface for action events?

[Ans: ActionListner] 137. When using a text field object, if the text entered by the user is longer than the

width of the text field, the text would be truncated. Is this statement is true and false? Comment. [Ans: False, the width of text can exceed the width of the text field]

138. If a user presses Enter key, while still being within a JTextField object, which event get fired? [Ans: ActionEvent]

139. Which controls allow text entry in them? [Ans: Text Field, Password Field, Text Area]

140. Which property would you set for setting the password character as ‘$’? [Ans: Set echoChar property of password field to ‘$’]

141. Name a component that display an icon, but that does not react to user clicks. 142. Name a component that looks like a button and that when pressed, brings up a

menu of items for the user to choose from. 143. Which list property do you set for specifying the contents of a list? [Ans: model] 144. Write index and position of first value in a list? [Ans: Index- 0, Position-1] 145. Which method would you use to determine which index has been selected in a

list? [Ans: getSelectedIndex( )] 146. How would you determine whether 7th item of a list namely MyList is selected or

not? [Ans: If method MyList.isSelectedIndex(6) returns true, then 7th item is selected] 147. You want to clear the selection in a list namely ChkList. How would you do this?

[Ans: By using method ChkList.clearSelection( ); ]

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 10

Page 11: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) 148. While working in NetBeans, Rajmeeta included a Listbox in the form. Now she

wants the list of her friend’s names to be displayed in it. Which property of Listbox control should she use to do this? [Ans: model]

149. Ms. Samhita has developed a Java application through which the students of her school can view their marks by entering their admission number. The marks displayed in various text fields. What should she do so that the students are able to view but not change their marks in text fields? [Ans: Set editable property of corresponding text fields to false]

150. While working in NetBeans IDE, Angad wants that in text area, the text should move to next line once it is filled width-wise and that too without breaking the word. What properties will help him do that? [Ans: Set LineWrap and WordWrap properties to true]

151. Ms. Kiran has developed a Java application for a restaurant billing, in which check boxes and text fields are made on form. Items are shown through check boxes. Selecting check boxes displaying corresponding text fields. Name the property which Kiran should use to perform the same.

152. Mr. Nayak has developed a Java application for a school, in which a combo box is made on the form for selecting class. Name the property which Mr. Nayak should use to add the class data in combo box.

153. While working in NetBeans IDE, Ms. Kanta wants to display ‘Cleared’ or ‘Re-attempt required’ message depending upon marks entered in jTextField. Help her to choose more appropriate statement out of ‘If statement’ and ‘Switch statement’. [Ans: If-else as she has to display either of the two messages]

154. Is a combo box by default editable? If Not, then how you make it editable? [Ans: No, set editable property to true]

155. How would you obtain selected item from a combobox? [Ans: By using method getSelectedItem( )]

156. What event does a JList fire when user selects an item? What event listener does a JList use? [Ans: ListSelection Event, ListSelectionListener]

157. Compare and contrast a list box and a combo box? 158. What method obtains the current selection of a combo box? Give a code example.

[Ans: String sel= (String) CityCB.getSelectedItem( ); ] 159. JFrame contains several panes. To what pane are the components added?

[Ans: content pane] 160. To what object must radio buttons be added in order for their mutually exclusive

behavior to be exhibited? [Ans: Radio buttons must be added to same button group (object of type JButtonGroup)]

161. An application has four radio buttons added to it, but more than one radio button can be selected. What could be the reason behind their such a behaviour? [Ans: Radio buttons are not added to same button group]

162. Which Swing component provides a pop-up list? [Ans: JComboBox] 163. Give one similarity and one difference between a checkbox and a radio button. 164. Which keyword refers to current object? [Ans: this] 165. What do you mean by function overloading? 166. What is polymorphism? Give an example. 167. What is overridden method? 168. Why do overridden methods on a subclass have priority over the superclass? 169. What is the difference between Method overloading and Method Overriding? 170. What are actual and formal parameters of a mehod? 171. Differentiate between call by value and call by reference with example?

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 11

Page 12: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) 172. Passing the address means call by value or call by reference?

[Ans: Call by reference] 173. What is this (i.e. this object)? 174. Write significance of constructors in OOP classes. 175. List some special properties of constructor methods. 176. How are parameterized constructors different from non parameterized

constructors? 177. At what time is the constructor method automatically invoked?

[Ans: Every time an object is created] 178. The new operator is linked with the constructor of the class. Comment?

[Ans: The new operator is used to create object of the class] 179. Which method of a class is invoked just once for an object?

[Ans: Constructor method] 180. We would like to make a member of a class visible in all subclasses regardless of

what package they are in. Which keyword would achieve this? [Ans: protected] 181. How protected members are different from public and private members of a class? 182. Define a class with reference to Object Oriented Programming. 183. If a class Student contains rollno, name and get_Details( ), then what is

get_Details( )? 184. How does a class enforce data hiding? 185. What is a package? 186. Name the package you need to import for performing input and output.

[Ans: java.io] 187. Which package is always imported by default in Java? [Ans: java.lang] 188. Name the package you need to import for performing database connectivity.

[Ans: java.sql] 189. Name the default access specifier of class members. [Ans: Friendly] 190. If a variable is declared as private, where may the variable be accessed? 191. How does the visibility mode control the access of members in derived class? 192. What will be the scope of a private, protected and public member of a class? 193. What does round( ) return if a negative float value is passed to it?

[Ans: Closest int value] 194. What is the difference between equals( ) and equalsIgnorecase( ) string functions? 195. What is the difference between length( ) and capacity( ) string functions? 196. Given a package named EDU.Student, how would you import a class named Test

contained in this package? Write one line statement. [Ans: import EDU.Student.Test; ]

197. What is inheritance? Name its various forms. 198. Give two advantages of inheritance. 199. What is the difference between importing and extending a class? 200. What type of inheritance does Java have? [Ans: Single, Multilevel, Hierarchical] 201. When creating a subclass, what keyword is used to include a super class?

[Ans: extends] 202. Can an object be a subclass of another object? [Ans: No] 203. Define Base class and Derived class? What are these classes alternatively known

as? 204. Does a super class have access to the members of a sub class? Does a sub class

have access to members of a super class? [Ans: No, Yes subclass has access to all non private members of its super class]

205. How do you prevent a sub class from having access to a member of a super class? Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 12

Page 13: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) [Ans: Declare members of super class as private]

206. What is an use of Extends and Implements keyword in java? 207. What is an interface? 208. Is Multiple inheritance is possible in java? If yes, How? 209. What is an abstract class and abstract methods? 210. How do you prevent a method from being overridden? [Ans: Declare as final] 211. How do you prevent a class from being inherited? [Ans: Declare as final] 212. If a base class contains a member function func( ), and its derived class does not

contain a function with this name, can an object of the derived class access func( )? 213. If a base class & a derived class each include a member function with same name

func( ), which member function will be called by an object of derived class, assuming the scope-resolution is not used? To call the other function, what can be done? [Ans: Member function of derived class will be called. To call base class function, super.func( )]

214. How many dialog types does Java support? [Ans: Four] 215. Write command to display a message dialog with display prompt as “Hello

World”, title as “My dialog” and icon as question-icon. [Ans: JOptionPane.showMessageDialog(null,”Hello World”, “My dialog”, JOptionPane.QUESTION_MESSAGE); ]

216. Which import command do you need to write before creating an Option pane dialog window? [Ans: import javax.swing.*; or import javax.swing.JOptionPane;]

217. Which one property of option pane dialog window turns it to Input dialog? [Ans: wantsInput property]

218. Name the class that provides an essay and convenient way to display standard dialogs for posting a message, asking a question or prompting for simple user input. [Ans: JOptionPane]

219. Which predefined dialog type of JOptionPane class does not return anything? [Ans: message dialog (invoked with showMessageDialog( ) )]

220. How would you obtain table model of a table myTbl1? [Ans: myTbl1.getModel( )]

221. Give two common properties of JTextField and JLabel? [Ans: text, font] 222. Write the use of methods charAt( ) and substring( ) in java. 223. What is the purpose of getConnection( ) method? 224. Explain the Resultset. 225. What is the purpose of JDBC?

[Ans: Establishing a connection with database, sending SQL statements to database server, processing the result oriented]

226. Write four JDBC Drivers? 227. How to open a connection to a database? [Ans: DriverManager.getConnection( )] 228. Which method is used to insert new records in a table? 229. In JDBC coding, what method would you use to move cursor forward by one row

in the recordset recSet? [Ans: recSet.next ( )] 230. In JDBC coding, what method would you use to move to first and last record of

the recordset recSet? [Ans: recSet.first( ) and recSet.last ( )] 231. In JDBC coding, what method would you use to move to 6th row of the recordset

recSet? [Ans: recSet.absolute(6);] 232. What is database connectivity? 233. How does Java application connect to a database? Name the technology only.

[Ans: Through a framework i.e JDBC or ODBC that helps it send and execute SQL statements from within the application.]

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 13

Page 14: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) 234. What all JDBC classes/objects are used in a database connectivity application?

[Ans: DriverManager Object, Connection Object, Statement Object, Resultset Object] 235. What are the two steps involved in establishing a JDBC connection?

[Ans: loading JDBC driver and making the connection] 236. How can you load the drivers?

[Ans: Use Class.forName( ). Eg. Class.forName(“com.mysql.jdbc.Driver”);] 237. Name two commonly used drivers used for database connectivity from Java

applications? [Ans: java.sql.Driver and com.mysql.jdbc.Driver] 238. Which methods are used to execute SQL queries?

[Ans: executeQuery( ) and executeUpdate( ) methods] 239. Write a statement to open a connection object namely myCon for a MySQL

database namely School. [Ans: String DB_URL= “jdbc:mysql:://localhost/School? User=”+ <userid>+”&password=”+ <pwd>; Connection myCon= DriverManager.getConnection(DB_URL);

240. Name the methods for the following: (a) To fetch an integer value from a resultset. [Ans: getInt( )] (b) To fetch a string value from a resultset. [Ans: getString( )] (c) To fetch a date value from a resultset. [Ans: getDate( )]

241. How is JDBC different from ODBC?

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 14

Page 15: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15)

UNIT-2 (Programming- Java GUI)

242. Rewrite the following program code using if…else if statement.

switch (per) {case 90:

System.out.println(“A1”); break; case 80:

System.out.println(“A2”); break; case 70:

System.out.println(“B1”); break; case 60:

System.out.println(“B2”); break; case 50:

System.out.println(“C1”); break; default:

System.out.println(“D1”); break; }

243. Rewrite the below code using a while loop: i=2; do{

System.out.println (“”+i); i += 2;

} while (i < 51); jOptionPane.showMessageDialog( null, “Thank you” );

244. Convert the following for loop into while loop: for (i=9; (i%3)<7; i--) { if (i==6) break; system.out.println(“i= ” + i); }

245. Rewrite the below code using a do…while loop i = 100; while (i > 0) {System.out.print ln( i--);} jOptionPane.showMessageDialog( null, “Thank you” );

246. Rewrite the following program code using for loop: int num=6; int temp=num; while(num>=1) { temp=temp-1;

if (temp%2==0) System.out.println(“Is even”);

else System.out.println(“Is odd”);

num=num-2; }

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 15

Page 16: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) 247. Rewrite the following program code using for loop:

int i=0; while(++i<20) { if(i==8) break; System.out.println(i++); }

248. Rewrite the following program code using a switch statement. if (d ==1) day=”Monday”; else if (d ==2) day=”Tuesday”; else if (d ==3) day=”Wednesday”; else

day=”-”; 249. Rewrite the following program code using a switch statement.

if (ch ==’E’) eastern++; else if (ch ==’W’) western++; else if (ch ==’N’) northern++; else if (ch ==’S’) southern++; else unknown++;

250. Rewrite following while loop into a for loop int stripes = 0; while (stripes <= 13) { if (stripes %2 == 2) System.out.print ln(“Colour code Red”); else System.out.print ln(“Colour code Blue”); stripes = stripes + 1; }

251. Write Java code that takes the cost of a pencil from jTextField1 and number of pencils from jTextField2 and calculate total amount as cost*number to be displayed in jTextField3 and 20% service tax out of total amount in jTextField4.

252. Write a method in Java that takes a number as parameter and return sum of its divisors?

253. Code to print series of squares of first 10 natural numbers and their sum. 254. Write a for loop coding that displays the numbers from 10 to 1. 255. Write a function in java that takes two numbers as input from textfields and

display their sum. 256. Write code in Java that takes principal, rate and time as input form textfields and

displays simple interest. 257. Write a method in java reverse_digit of type int which calculate the reverse of

digit of a number passed as an argument. 258. Write a Java method that receive a 3 digit integer and returns its middle digit.

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 16

Page 17: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) 259. Write a function in java that takes two numbers as parameters. It then returns that

number whose square is greater than the square of other number. In case of equality either number is returned.

260. Write a function in java that takes cost price and selling price of a good as input and returns the profit made by the shopkeeper.

261. Write a function in java that takes a year as parameter and returns 1 if it is leap year and 0 otherwise.

262. Write a function in java that takes temperature of a city in Fahrenheit as parameter and returns this temperature after converting it into Centigrade degrees.

263. Write a java code to display system date and the date before 763 days from system date today’s date.

264. Write a method in Java that takes a number as parameter and return true if the number is prime otherwise return false.

265. Write a method in Java that takes a number as parameter and return sum of digits of number.

266. Write a method in Java that takes a number as parameter and return product of digits of number.

267. Write a method to calculate factorial of a given number. 268. Write a method in Java that takes a number as parameter and check whether it is

even or odd. 269. Write a method in Java that takes a string as parameter and check whether it is

palindrome or not. 270. What will be the content of jTextField1 and jTextField2 after executing the

following code: String st= “New to Information Technology”; jTextField1.setText(st.replace(“Technology”,”Practices”); jTextField2.setText(st.substring(7));

271. Write the purpose of the following statements: jTextField1.setText(“Computer”.subString(2,5)); jTextField2.setText(“Informatics”.subString(3)); [Ans: ormatics]

272. What will be the value of jTextField1 after executing the following code: jTextField1.setText(“Information”.reverse( ));

273. What will be the contents of jTextField1 and jTextField2 after executing the following code: String s = "PQR Micro Systems"; jTextField1.setText(s.length( )+" "); [Ans:17] jTextField2.setText(s.toLowerCase( )); [Ans: pqr micro systems]

274. What will be the contents of jTextField1 and jTextField2 after executing the following: String name1= “Hello World”; name1= name1.toLowerCase( ); String name2= name1.replace(‘ ‘, ‘!’); jTextField1.setText(name1); jTextField2.setText(name2);

275. What will be the contents of jTextField1 and jTextField2 after executing the following: String name1= “Informatics Practices”; name1= name1.toUpperCase( ); String name2= name1.subString(1,5); jTextField1.setText(name2);

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 17

Page 18: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) jTextField2.setText(name1);

276. What will be displayed in jTextArea1 after executing the following statement? jTextArea1.setText(“CBSE \nFinal_Exam_IP \t2012”);

277. What will be the content of jTextField1 and jTextField2 after executing the following code: jTextField1.setText(Math.round(2.3)+” ”); [Ans: 2] jTextField2.setText(Math.pow(2,3)+ “ “); [Ans: 8.0]

278. What will be the output of following code: String st= “Sharda”; for(int i=0;i<st.length( );i++) { System.out.println((st.substring(st.length( )- i)).toUpperCase( )); }

279. Given a string object namely ‘subject’, having value as “123” stored in it. What will be result of the following: [Ans:126] JOptionPane.showMessageDialoge(null,”“+(subject.length()+ Integer.parseInt(subject)));

280. What will be the contents of jTextArea1 after executing the following statement: jTextArea1.setText("Pure\n\nObject\nOriented\tProgramming");

281. What will be the output of following code: public static void main(String [ ] args) { System.out.println(“My\n country \n is \n great”); }

282. An employee_id consisting of 5 digits is stored in a string variable strEmpId. Now Mrs. Devi wants to store this Id in Integer type of variable IntEmpId. Write Java statement to do this.

283. A phone number consisting of 10 digits is stored in a string variable strPhone. Now Mr. Dev wants to store this phone number in a Long type of variable LngPhone. Write Java statement to do this. [Ans: long LngPhone=Long.paresLong(strPhone);]

284. Suppose a variable Val assign a value 100, write the possible statements to display the value in a JLabel control (jLabel1).

285. If a string MyString holds a value “12345”, then how you will convert into integer type. Write the command.

286. Given an int variable K with value 253. It is to be converted into equivalent string i.e. “253”. What are the two ways of doing that? [Ans: “ “ + K and String.valueof(K)]

287. What will be set as text of textfield JTF as per following statements? (a) JTF.setText(‘A’+’a’); [Ans: 162] (b) JTF.setText(‘A’+’a’); [Ans: Aa] (c) JTF.setText(‘A’+’B’); [Ans: 131]

288. How many times the following loop executed? int x=5, y=50; while(x<=y) { x= y/x; }

289. How many times does the following loop execute? What is it type (Entry or Exit controlled loop)? [Ans: 7, Entry Controlled Loop] int x=2,y=20; while (x<=y){

JOptionPane.showMessageDialog(null,” “+x); x=x+3;

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 18

Page 19: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) }

290. How many times will each of the following loops execute? Which one of these is an entry controlled loop and which one is an exit controlled loop.

Loop1 Loop2 int s=0,a=4; while(a<=10) { s=s+a; a=a+2; System.out.println(s); }

int s=0,a=4; do { s=s+a; a=a+2; System.out.println(s); } while(a<=10);

291. What will be the value of sum after execution of the following code? int i, sum=2; for(i=3;i<8;i++) { if(i%4==0) { sum+=i; break; } else sum+=i/2; }

292. What will be the value of P and Q after execution of the following code? int P, Q=100; for (P=10;P<=12;P++) { Q+=P; } System.out.println(“P:” + P + ” Q:”+Q);

293. What will be the value of x and y after execution of the following code? [Ans:7,4] int x, y=0; for(x=1;x<=5;++x) y=x++; --y;

294. What will be the output of the following code? [Ans: No output] int a=10,b=5; if(a>b){

if(b>5) System.out.println(“b is”+b);

} else

System.out.println(“a is”+a); 295. What will be the output of the following code?

int j=1, s=0; while(j<10) { System.out.print(j + “+”);

s= s + j; j= j + j%3;

} System.out.println(“=” + s);

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 19

Page 20: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) 296. Find out the output of the following java code:

int j=1, s=0; while (j<10) {

System.out.print (j +”+”); s= s+j; j= j+ j % 3; }

System.out.println (”=”+s); 297. Find out the output of the following java code:

float x=9; float y=5; int z=(int) (x /y); switch(z) { case 1 : x= x+2 ; case 2 : x= x+3; default: x= + 1; } System.out.println(“Value of x:” +x);

298. Find the output of the following code fragments? (a) int s = 14; (b) int s = 14; if(s<20) if(s<20) System.out.print(“Under”); System.out.print(“Under”); else else { System.out.print(“Over”); System.out.print(“Over”); System.out.print ln(“the limit”); System.out.print ln(“the limit”); } (c) int s = 94; (d) int v1=5, v2=10; If (s < 20) { for(int x=1;x<=2;x++) System.out.print(“Under”); { } System.out.println(++v1 + ”\t” + v2--); else { System.out.println(--v2 + ”\t” + v1++); System.out.print(“Over”); } } System.out.print ln(“the limit”);

299. What will be the value of a and b after execution of following code:

jlabel1.setText(" "+a+","+b); 300. What will be the value of i and j after execution of following code:

int i=1,j=1; for( ; ; ) { if (i>5)

break; else

j+=i; i+=j;

}

int a=1,b=2; if(++b<5) { a*=b; }

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 20

Page 21: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) 301. What will be the value of sum after execution of the following code?

double i, sum=2; for(i=3;i<8;i++) { if(i%4==0)

{ break; sum=Math.pow(sum,i);

} else

sum+=i/2; }

302. What will be the content of jTextField1 after executing the following code: [Ans:7] int Num = 6; Num = Num + 1; if ( Num > 5)

jTextField1.setText(Integer.toString(Num)); else

jTextField1.setText(Integer.toString(Num+5)); 303. Find the output:

int f=1,i=2; do { f*=i; } while(++i <5); System.out.println(f);

304. Give the output of the following: i. int i,j,n; ii. for (n=3;n>=1;n--)

n=15; i=1; { do { switch (n+1){ n++; case 3: System.out.println(“Three”); i++; case 4; System.out.println(“Four”); }while (i<=5); case 1; System.out.println(“One”); break; default: System.out.println(“Two”); }

305. What will be the value of x after execution of the following code? Also find how many times the following loop will execute? int a=10, b=12, x=5, y=6; while(a<=b) { if(a%2==0)

x=x+y; else

x=x-y; a=a+1;

} 306. What will be the value of x after execution of the following code?

int j=10,x=0,i=0; for(i=1;i<=4;i++) { if(i%2==0)

x=x+(i*j); j=j-2;

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 21

Page 22: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) }

307. What will be the output of the following program code: public class MyClass{ int a,b; void set(int I,int J) { a=I;

b=j; } void show() { System.out.println(a+” “ +b+’\n’); } public static void main(String k[]) { MyClass o1=new MyClass();

MyClass o2=new MyClass(); o1.set(10,4); o2=o1; o1.show(); o2.show();

} }

308. What will be the output the following code fragment if the value of ch is (i) a (ii) c (iii) d (iv) b? switch (ch) { case ‘a’: system.out.println(“It is a.”);

case ‘b’: system.out.println(“It is b.”); case ‘c’: system.out.println(“It is c.”);

break; case ‘d’: system.out.println(“It is d.”);

break; default: system.out.println(“Not a, b, c and d.”);

}

309. Identify the output in the following code where num1TF contains “12” and num2TF contains “34”. [Ans: 1235] int value= Integer.parseInt(num1TF.getText( ) + num2TF.getText( )); JOptionPane.showMessageDialog(null,” “ + (value+1));

310. Rewrite the correct code underlining all the corrections made: int sum=0,step=5; int I; for(i=0, i=<5, i++) { step+=5; sum+=step; } jTextArea1.showText(“ “+sum);

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 22

Page 23: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) 311. The following code has some error(s). Rewrite the correct code underlining all the

corrections made: int i=2; j=5; while j>i { jTextField1.getText("j is greater"); j--;

++i; } JOptionpane.showMessageDialog("Hello");

312. Rewrite the correct code underlining all the corrections made: Int k=2 ; sum=0; { sum =k; K+=2; } while (k=<20); jTextField1.getText(“ “ + sum);

313. Identify the error in the following code and correct it: int j=20; k=256; while (j<30){

k=Math.sqrt(k); system.out.display(“Now, Value of K is “+k); }

314. Rewrite the correct code underlining all the corrections made: int i, j=5; i== j+5; if(i=j) { jTextField1.setText(“i and j are unequal”); jTextField2.setText(“they are not equal”); break; } else

jTextField1.setText(“i and j are equal”) 315. Identify the errors in the following lines:

(a) int principal= prinTF.getText( ); [Ans: int principal= Integer.parseInt(prinTF.getText( ));]

(b) int time= timeTF.getText( ); [Ans: int time= Integer.parseInt(timeTF.getText( ));]

(c) float int= principal*0.08*time; [Ans: float intr= principal*0.08*time;]

(d) JOptionpane.showMessageDialog(“Interest is”+int); [Ans: JOptionPane.showMessageDialog(null,“Interest is”+intr);]

316. Rewrite the corrected program after removing syntax errors, underline the corrections:

Integer P=1; Integer C=1; FOR C= 1 TO 10 P = P+1 IF P= 5 THEN P=1 DISPLAY “P IS EQUAL TO 5” ELSE DISPLAY “P IS NOT EQUAL TO 5”

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 23

Page 24: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) 317. Ruchika developed following GUI in Netbeans to calculate wages to be paid to

labourers. Male and female labours are respectively paid at the rate of Rs.160/- and Rs.140/- per day. Skilled labours are paid of Rs.50/- extra per day. (You can assume various names for various controls of the form).

a) What should be done so that only one of the radio buttons (Male and Female) should

be selected one at a time? b) Write code to calculate in corresponding text field and display total wages in Total

Wages when the “Calculate Wages” Button is clicked. c) Write code to clear all text fields, uncheck checkbox and set option button male as the

Default category. d) Close the application when STOP button is pressed. e) Write the code for focusLost event of NoDaysTF text field to ensure that the user

does not enter a negative or a zero value. If a negative value or zero value is entered then the text field should be made blank and a warning message should be displayed.

f) Write the code to disable the text field Total Wages. 318. Given below the Form to calculate area and volume of circle and cube:

a) Write the code for calculate button to calculate area and volume depending on the

choice of user? b) Write the code clear all the controls when Clear button will be clicked? c) Write the code for exit button so that when a user clicks on exit button Application

will be closed. Also display a message “Thank you” before exiting the application. d) Write the code to disable text fields for area of circle and volume of cube.

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 24

Page 25: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) 319. HSBC is a bank. The Bank provides three types of loans- Car loan, House Loan,

Education Loan.

Make a java swing frame as shown above and accept values through jTextFields. Perform according to following questions: a) Write the command to clear all the text boxes. b) Write the command to set focus on Exit button and disable all other buttons. c) Write the commands to show interest rate according to the following criteria:

Car loan – 10% House Loan – 8.5% Education Loan – 5%.

d) Write the code for Exit button to close the application. e) Write code to make the text field for Interest rate and Discount uneditable. f) Calculate the discount on the amount according to following criteria. If amount > 10,000,00 and < 20,000,00 then 20% discount. If amount > 20,000,00 then 25 % discount.

320. Following is a JAVA interface to input the details of student for annual fee collection. Criteria of fee are as follows:

The additional charges Hostel, mess and internet charges will be applicable only if selected.

a) Write code on calculate button to calculate annual fee to be deposited. b) Write code on clear button to clear all the text fields, radio buttons and check box.

Medical student Rs.80000/- Non-medical student Rs.50000/- Hostel charges Rs.24000/- Mess Charges Rs.12000/- Internet facility 1200/-.

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 25

Page 26: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) 321. Following is a JAVA interface to generate ticket amount for the visitors in a trade

fare. Ticket amount for visitors below 18 years of age or female visitors is Rs.80 and for others Rs. 100. 10% discount will be given for army personnel’s.

a) Write code on check button to calculate ticket amount and display it as given in the interface. b) Write code on clear button to clear all the text box and check button.

322. K.K.Group of hotels has computerized it booking system. The following is the Booking From along with details;

a) When the form loads text boxes for Room charges, fooding charges, discount and

total are disabled. b) Whenever clear button is clicked all text box and check box will be cleared. c) Check that number of days of stay entered is numeric. d) When the command button Calculate Charges is clicked all the charges along with

discount & Total computed and displayed. Then criterion for the calculation of charges is given below: Total = (Room charges + fooding charges - discount) + 12% VAT Single Room:- Rs.400 per day Double Room :- Rs.700 per day Breakfast:- Rs.100 per day Lunch: Rs.180 per day Dinner: Rs.200 per Day Gold card member will be given 20% discount on total charges.

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 26

Page 27: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15)

UNIT-2 (Programming Concepts- Web Application Development)

1. What do you understand by: (a) URL (b) Multimedia? 2. Differentiate between a web browser and web server with two example of each? 3. In the URL, http://www.mycorp.com/pr/master.htm, what is the http component?

[Ans: http: specifies the type of server] 4. In the URL, http://www.mycorp.com/pr/master.htm, what is the www.mycorp.com

component? [Ans: address of server] 5. In the URL, http://www.mycorp.com/pr/master.htm, what is the /pr/master.htm

component? [Ans: path of the file master.htm] 6. Which protocol is used to upload/ transfer the file from host to server Internet? 7. How is a file communicated to another computer on Internet? [Ans: Through FTP] 8. What is WWW? How does it function? 9. A web browser & web server are an application of client/server computing concept.

Comment on these statements? 10. Can you give example of a real life situation that uses client/server computing? 11. What is URL? What are its components? Exemplify? 12. What is CGI? How it works in Dynamic web Page service? 13. Differentiate between Static and Dynamic Web Service? 14. HTML stands for? [Ans: Hyper Text Markup Language] 15. What do you understand by ‘Tag’?

[Ans: Coded HTML command that indicates how part of a web page is displayed] 16. What is an attribute in HTML?

[Ans: Used inside HTML tag which specifies additional information to tag such as colour, alignment, width etc.]

17. Define the tag, <HTML>? [Ans: Identifies the document as HTML document] 18. HR tag is used for? [Ans: Separating sections of a document visually] 19. <Title> tag is used to define? [Ans: document’s title] 20. Face attribute is used with which tag and what is its use?

[Ans: Used with <Font> tag for changing font type of text] 21. To align multiple lines of text, we used? [Ans: Align attribute] 22. List the attribute of <Font> tag? [Ans: size, face and colour] 23. List different types of paragraph alignments? [Ans: Left, Right, Center] 24. Can you assign justified alignment to a paragraph in HTML? 25. The value of #FFFFFF is? [Ans: White] 26. The value of #000000 is? [Ans: Black] 27. The default alignment of text, text colour and background colour are?

[Ans: left, black, grey] 28. The tags that require a starting as well as ending tag are called? [Ans: container element] 29. To specify background image for document, background attribute is used with which tag?

[Ans: <Body>] 30. Which HTML tag and corresponding attributes are used to include an image as the

background of an HTML document? 31. To specify the basic font size, which tag is used? [Ans: <BASEFONT>] 32. What is the difference between <BASEFONT> and <FONT> tag? 33. What is the use of <Center> tag in HTML document?

[Ans: Used to center align text and image] 34. Comments are enclosed in which tags? [Ans: <!--, -->]

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 27

Page 28: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) 35. How is <P> tag different from <BR> tag in HTML?

[Ans: <BR> tag forces text to a new line like <P> tag, but without inserting a blank line.] 36. The textual content that appears in source HTML document but is not rendered by

browser? [Ans: comment] 37. Two tags that break the line flow are? [Ans: <BR>, <HR>] 38. Which attribute is used in <Body> tag to set background colour? [Ans: Bgcolor] 39. What type of lists are supported by HTML? [Ans: Unnumbered, Numbered, Definition] 40. Which three tags let you create the definition lists? [Ans: <DL>, <DT>, <DD>] 41. Which two tags let you create the unnumbered lists? [Ans: <UL>, <LI>] 42. Which two tags let you create the numbered lists? [Ans: <OL>, <LI>] 43. Which tags are used to create tables in HTML? [Ans: <TABLE>, <TBODY>,

<THEAD>, <TFOOT>, <TR>, <TD>, <TH>] 44. Which attribute lets you control the display of select border sides of a table?

[Ans: Frame attribute] 45. Which attribute is used to control the inside table border? [Ans: Rules attribute] 46. How is spacing in cells of table controlled?

[Ans: By using CELLSPACING and CELLPADDING attributes] 47. Name the attribute used for changing cell span? [Ans: ROWSPAN and COLSPAN] 48. Name the attribute used for aligning cell contents vertically? [Ans: VALIGN] 49. What for are <TH> and <TR> tags used? 50. A set of header rows is defined using which tag? [Ans: <THEAD>] 51. What do you understand by controls in forms? Name some controls supported by HTML

forms? [Ans: Buttons, Checkbox, Radio Buttons, Menus, Text Boxes, Text Area] 52. Write the tag to define a radio button, a text box, a submit button and a label?

[Ans: <INPUT type=”radio” name=”rbutton” value=”radio button”> <INPUT type=”text” name=”name of text box”> <INPUT type=”submit” name=”submit” value=”submit”> <LABEL for=”label”> content here </LABEL>]

53. Write HTML code to produce a text area with 10 rows and 30 columns? 54. Define the following: XML(Extensible Markup Language), CSS(Cascading Style Sheet),

EDI(Electronic Data Interchange). 55. Write some features of XML. 56. What do you understand by elements and attributes of XML documents? 57. What is a markup language?

[Ans: set of rules/tags that defines structure and format of text] 58. Name a pre-defined markup language. [Ans: HTML] 59. Name a meta- language. [Ans: SGML, XML] 60. What is the significance of root element? What is its alternative name?

[Ans: document element] 61. What all tags are required in every HTML page?

[Ans: <HTML>, <HEAD>, <TITLE>, <BODY>] 62. How are tags used in XML different from tags in HTML? Write two points.

XML tags HTML tags New tags can be created using XML tags. New tags cannot be created using HTML tags. XML tags cannot be empty tags. HTML tags can be empty tags.

63. Differentiate between <TITLE> and <HEAD> tags? 64. List different types of heading tag. [Ans: <H1>, <H2>, <H3>, <H4>, <H5>, <H6>] 65. Which tags are used to bold and underlined the text? [Ans: <B>, <U>] 66. Which HTML tag inserts a horizontal straight line on a web page? [Ans: <HR> tag]

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 28

Page 29: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) 67. What is the use of <H1> tag in an HTML document?

[Ans: Display text with largest font size so as to act as a heading] 68. Mention the purpose of each of the following HTML tags.

<BR>, <LI>, <HR>, <TABLE> 69. What are the two table dimension tags? [Ans: <TR>, <TD>] 70. In order to add border to the table, BORDER attribute is specified in which tag?

[Ans: <TABLE> tag] 71. Which HTML tags are used for making a table and adding rows in a HTML document?

[Ans: <TABLE> and <TR>] 72. What is wrong with following code?

<EMAIL> <TO> [email protected] </TO> <Body> Hi There </Body> </email> [Ans: XML is case sensitive thus ending tag should be </EMAIL>]

73. Differentiate between <UL> and <OL> tags? 74. What HTML container tags do you apply to text to format the text as a paragraph? 75. Which HTML command would you use to indent a single word and put a square bullet in

front of it?

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 29

Page 30: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15)

UNIT-3 (Relational Database Management System)

323. What is the function of DBMS? 324. What is SQL? What are the different categories of SQL commands?

[Ans: DDL, DML, TCL, DCL] 325. Give key features of MySQL? 326. What is data redundancy? 327. Differentiate between DDL and DML commands with two examples of each. 328. Name the different data models available for database systems.

[Ans: Relational, Network, Hierarchical, Object Oriented] 329. Which data model is the most preferred one? [Ans: relational model] 330. What is a datatype? Name some datatypes available in MySQL. 331. Compare char and varchar datatypes. 332. What is a constraint? Name some constraints that you can apply to enhance

database integrity. 333. What is default value? How do you define it? What is default value for a column

for which no value is defined? 334. What do mean by table level and column level constraint? 335. What is the significance of Not Null constraint? 336. What is the role of UNIQUE constraint? How is primary key constraint different

from unique constraint? 337. Name the constraints which can be added at both the levels (table and column). 338. What is primary key constraint? Explain with a suitable example. 339. In a student table, out of rollno, name, address which column can be set as

primary key and why? 340. While creating a table ‘Customer’, Sneha forgot to set the primary key for the

table. Give the statement which she should write now to set the column ‘CustID’ as the primary key of the table? [ Ans: alter table customer add primary key(CustID); ]

341. When a primary key constraint is included in a table, what other constraints does this imply? [Ans: Unique + Not Null]

342. Define foreign key, candidate key, alternate key. 343. Define relation, tuple, attribute, domain, degree, cardinality. 344. What must exist on parent table before MySQL will allow you to create a foreign

key constraint from the child table? [Ans: primary key] 345. A table “Stock” in a database has 5 columns and contains 17 records. What is the

degree and cardinality of this table? [Ans: Degree=5 and Cardinality=17] 346. A table ‘Customers’ in a database has 5 columns and no rows in it. What is its

cardinality? What will be its cardinality if 4 rows are added in the table? [Ans: In first case cardinality: 0 and in second case cardinality: 4]

347. A table Sports1 in a database has 3 columns and 30 rows. Another similar table Sports2 has 3 columns and 50 rows. All the records from Sports2 are added into Sports1 table. What is the degree and cardinality of both these tables now?

348. A table “Trains” in a database has degree 3 and cardinality 8. What is the number of rows and columns in it?

349. Define a transaction. 350. What TCL commands are supported by SQL?

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 30

Page 31: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) 351. Which statement is used to mark the start of a transaction? 352. What do you mean by committing a transaction? 353. What does transaction rollback indicate? 354. What is the use of savepoint? 355. Which command is used in MySQL to make the changes in database permanent?

[Ans: commit] 356. Which command is used in MySQL to undo the changes made during transaction

execution? [Ans: rollback] 357. Which statement is used to disable or enable the transaction? 358. What are the different properties of transactions maintained by database systems? 359. What are the two ways in which multiple transactions can be executed?

[Ans: serially, concurrently] 360. What is Cartesian product? How is it related to join? 361. What is a join? How many different types of joins can you create in MySQL? 362. How is natural join different from an equi-join? 363. How is equi-join different from a non equi-join? 364. What is table alias? What is it purpose? 365. Can you join two tables without using the keyword JOIN? [Ans: Yes] 366. What is the query called that combines rows from two or more tables?

[Ans: Join query] 367. When a column’s value is skipped in an insert command, which value is inserted

in the database? [Ans: default value, if it is defined for that column, otherwise, NULL value]

368. What SQL clause is used to restrict the rows returned by a query? [Ans: where clause]

369. Which keyword is used to eliminate the redundant or duplicate data from a query result? [Ans: distinct]

370. Which command is used to add a new row in a table? [Ans: insert command] 371. Aahna wants to add some records (with balance >10000) from an old table

chequeold to another table namely chequenew. What command should she use for this? [Ans: insert into chequenew select * from chequeold where balance>10000; ]

372. Bank accountant needs to change the last name of one of his customer in table customer. Which command should be used for this? [Ans: update command]

373. In a where clause, you can ask for any value ending in “qpt” by writing? [Ans: like “%qpt”]

374. Swati needs to display name of those students who have “A” as second character in their name. She writes the following query: select name from student where name like ‘%A%’; But the query is not producing the correct result. Identify the problem.

375. Which function is used to get the current time in MySQL? [Ans: now( )] 376. Whether a table may be joined to itself? [Ans: True] 377. In where clause which keyword is used to restrict the rows returned by a query

depending on validity of two conditions simultaneously? [Ans: and] 378. Which command should be used to create a database named “student”?

[Ans: create database student;] 379. After creating the “student’ database, you want to use it. Which command should

you give? [Ans: use student;] 380. Naved wants to list the names of all the tables in his database namely “Status”.

What commands should he write at MySQL prompt to get this result? Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 31

Page 32: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) [Ans: use status; show tables; ]

381. State True or False whether a NULL value is treated as a blank or 0? [Ans: False] 382. What is the purpose of Alter command in MySQL? How is it different from

update command? 383. Which command will delete the table data as well as table structure? [Ans: drop] 384. What is the purpose of DROP table command in SQL? How is it different from

delete command? 385. Sheela needs to remove all the rows in the Sales table to release the storage space

without to remove the table structure. Which statement should he use? [Ans: delete from Sales;]

386. Aman needs to remove all the data in the Exchange table and the structure of the table along with the indexes associated with the table. Which statement should he use? [Ans: drop table Exchange;]

387. On the Schedule table, schedule_id is primary key, name is customer name. Evaluate this delete statement whether it is correct or not. Give reason. delete schedule_id, name from Schedule;

388. Meena uses a EMP table with following columns: NAME, SAL, ID, DNAME She needs to display names of employees who have not been assigned any department or have been assigned “pathology” department. Pathology course’s names end with “Pathology”. She wrote the following query: SELECT NAME, SAL FROM EMP, COURSE WHERE DNAME = NULL OR DNAME = “%pathology”; But the query is not producing result. Identify the problem.

389. Another names for table columns are? [Ans: attribute, fields] 390. The NULL keyword is used to? [Ans: represent unknown or missing values] 391. How many primary keys can be there in a table? [Ans: one at most] 392. Can a table have multiple primary keys? [Ans: No] 393. Can you have multiple foreign key constraints in a table? [Ans: Yes] 394. Can a foreign key column refer to the primary key of its own table? [Ans: Yes] 395. Which clause should you use to exclude group results? [Ans: having] 396. What is the difference between a Where clause and a Having clause of SQL select

statement? 397. Can we use Where clause in Group By clause? 398. Name the command to describe the structure of the table. 399. Which clause is used to arrange the data in ascending or descending order?

[Ans: Order By] 400. List five aggregate functions? [Ans: max, min, sum, avg, count] 401. What is the purpose of following SQL query:

select max(salary) from emp; 402. Sahil created a table in MySQL. Later on he found that there should have been

another column in the table. Which command should he use to add another column to the table? [Ans: alter table]

403. Rama is not able to change a value in a column to NULL. What constraint did she specify when she created the table? [Ans: NOT NULL or PRIMARY KEY]

404. Pooja, a student of class XI, created a table “Book”. Price is a column of this table. To find the details of books whose prices have not been entered, she wrote following query:

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 32

Page 33: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) select * from Book where Price= NULL; Help Pooja to run the query by removing the errors from the query and rewriting it. [Ans: select * from Book where Price IS NULL;]

405. Write SQL command to display current system date. 406. Consider two fields B_date, which stores the birth date and J_date, which stores

the joining date of an employee. Write commands to find out and display the approximate age of an employee as on joining date.

407. In MySQL, what table type (storage engine) is required for foreign keys to work? [Ans: InnoDB]

408. Name the default storage engine of MySQL? [Ans: MyISAM] 409. Write the command to disable the foreign key?

[Ans: set foreign_key_checks=0; ] 410. How would you find the storage engine of your table?

[Ans: show create table <table_name>;] 411. What is the result of following arithmetic expression, NULL + 15? [Ans: NULL] 412. Identify the error in following query: delete all from table employee; 413. Change the data type of column pincode to varchar(10) in the table customer.

[Ans: alter table customer modify (pincode varchar(10));]

414. Add one column email of data type varchar and size 30 to the table customer. [Ans: alter table customer add (email varchar(30));]

415. Write a query to display empno, ename, sal and sal*12 as Annual Salary whose commission is not NULL from table emp. [Ans: select empno, ename, sal, sal*12 as “Annual Salary” from emp where comm IS NOT NULL;]

416. “PrincipalName” is a column in a table “School”. The SQL queries select count(*) from school; and select count(PrincipalName) from school; Give the result 28 and 27 respectively. What may be the possible reason for this? How many records are present in the table- 27 or 28?

417. Jacob is not clear about the difference between the following two statements: (i) select (9-6) *12; (ii) select (9-6) *12 from empl; Help him to understand the difference between these two statements. [Ans: First statement display result 36 only once, but second statement display result 36 for every row in table empl. i.e. if table has 4 rows then it display 36 four times.]

418. What will be the output of following queries on the basis of employee table: empid ename salary A1 Bob NULL B1 John 4000 B2 Tom 5000 (a) select count(salary) from employee; [Ans: 2] (b) select count(*) from employee; [Ans: 3] (c) select avg(salary) from employee; [Ans: 4500] (d) select salary+100 from employee where empid=B1; [Ans: 4100] (e) select concat(‘empid’,empid), salary from employee where empid=B2;

[Ans: empidB2 5000] Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 33

Page 34: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) 419. What will be the output of following code?

(a) select concat (concat (‘Inform’,’atics’),’Practices’); [Ans: InformaticsPractices] (b) select concat (lower(‘Class’),upper(‘ xii’)); [Ans: class XII] (c) select count(‘Inform’,’atics’); [Ans: 2] (d) select round(6.5675,2); [Ans: 6.57] (e) select round(4.132,1); (f) select truncate(5.3456,1); [Ans: 5.3] (g) select dayofmonth(‘2009-08-25’); [Ans: 25] (h) select mid(‘Class 12’,2,3); [Ans: las] (i) select lower(concat(‘Prac’,’Tices’)); (j) select trim(“ Trailing spaces from welcome “); (k) select 5 mod 6; (l) select length(“Ramesh Sharma”); (m) select pow(5,2) + pow(2,-2); (n) select 100 + sqrt(100); (o) select floor(100.34); (p) select ceil(32.33); (q) select left(‘Ramesh Sharma’,5); (r) select substr(trim(‘ India is great ’),3,9); (s) SELECT INSTR(‘INFORMATICS’,’A’); [Ans:7] (t) Select ROUND(124.44) + POW(4,2); (u) Select YEAR(‘2009-08-15 01:02:03’) + 20; (v) Select LCASE(RIGHT(‘AMITY INTERNATIONAL SCHOOL’,6));

420. Write an SQL query to create the table ‘Menu’ with the following structure:

Field Type Constraint ItemCode Varchar(5) Primary Key ItemName Varchar(20) Not null Category Varchar(20) Default ‘Chinese’ Price Decimal(5,2) >100

421. In a database there are two tables ‘LOAN’ and ‘BORROWER’ as shown below: LOAN

Loan_No Branch_Name Amount K-170 Downtown 50000 K-230 Redwood 60000 K-260 Perryridge 37000

BORROWER Borrower_ID Customer_Name Loan_No 1061 Jones K-170 1062 Smith K-265 1063 Hayes K-230

(a) How many rows and columns will be there in the Cartesian product or cross join of these two tables? [Ans: Rows:9 and Columns:6 ]

(b) Which column in the ‘BORROWER’ table is the foreign key? [Ans: Loan_No] (c) Identify the primary key column in table BORROWER. [Ans: Borrower_ID] (d) How many rows will be there in left outer join of these two tables? [Ans: 3] (e) How many rows will be there in equi- join of these two tables? [Ans: 2] (f) How many rows will be there in non equi- join of these two tables? [Ans: 7]

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 34

Page 35: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) (g) How many rows and columns will be there in the natural join of these two tables?

[Ans: Rows:2 and Columns:5 ] (h) Check every value in Loan_No column of both the tables. Do you find any

discrepancy? [Ans: In 2nd row of Borrower table the value of Loan_No is K-265 which does not exist in the table Loan]

422. Create table Employee as per following Table instance chart.

Column Name EmpID Ename EmpPhone EmpSal DeptID Key Type Primary Foreign Nulls/Unique Not Null Unique FK Table Department FK Column Dept_ID Datatype Char Varchar Number Number Varchar Size 4 20 11 9,2 2

423. The Title and Price columns of table “Library” are given below: TITLE PRICE Mastering C++ 495 Guide Network 500 Mastering SQL 650 Dos GUIDE 400 Basic for beginners 399 Mastering Window Null

Based on this information, find the output of the following queries: (a) SELECT MIN(Price)from library; (b) SELECT COUNT(Title) from library WHERE Price < 150; (c) Select AVG(price) from library WHERE title like ‘%e%’; (d) Select title from library where price = (select max(price) from library);

424. Consider the table Hospital given below: No Name Age Department DateOfAdm Charges Sex 1 Sandeep 64 Surgery 23/02/97 400 F 2 Ravina 24 Orthopedic 20/01/98 200 F 3 Karan 45 Orthopedic 10/02/97 200 M 4 Tarun 12 Surgery 01/01/98 300 F 5 Zubin 36 ENT 12/01/98 250 M 6 Ketaki 16 ENT 12/02/98 300 F 7 Ankita 29 Cardiology 20/02/98 800 F 8 Zareen 45 Gynecology 22/02/98 500 F 9 Kush 19 Cardiology 13/01/97 800 M 10 Shailya 31 Medicine 19/02/97 400 F

Write commands in SQL for (i) to (xvi) (i) To show all information about the MALE patients of cardiology department. (ii) To list the names of male patients who are in orthopedic department. (iii) To display Patient’s name, charges, Age for female patients. (iv) To count the number of patients with Age < 30. (v) Increase the charges of male patient in ENT department by 4%.

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 35

Page 36: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) (vi) Add another column email_id with suitable data type. (vii) Delete the records of all female patients in Surgery department. (viii) Display a report listing name, age, charges and amount of charges including VAT as

2% on charges name the column as total charges and keep the data in ascending order of name.

(ix) To list name and department of those patients in which date of admission is before 23/02/1997 from hospital table in descending order of their name.

(x) To show the name of those patients who have first alphabet as ‘S’ and third alphabet as ‘n’ from hospital table.

(xi) To display the second largest charges from hospital table. (xii) To find the total charges of those patients who are admitting in Orthopedic

department. (xiii) To display the difference of highest and lowest charges of each department having

maximum charges more than 300. (xiv) Find out the details of patients whose age is same or more than that of patient whose

hospital charges are maximum. (xv) Display the details of all the patients who are hospitalised in 1998. (xvi) Display the sum of charges of various departments.

Find the output for SQL commands (xvii) to (xxiii). (xvii) SELECT COUNT(DISTINCT Department) FROM HOSPITAL; (xviii) SELECT MAX(Age) FROM HOSPITAL WHERE SEX=’M’; (xix) SELECT AVG(Charges) FROM HOSPITAL WHERE SEX=’F’; (xx) SELECT SUM(Charges) FROM HOSPITAL WHERE DATEOFADM < ’12/08/98’; (xxi) select name, age, department from hospital where Sex= ‘M’ ; (xxii) SELECT DISTINCT Department FROM HOSPITAL; (xxiii) select count (*) from Hospital where Sex=’F’;

425. Consider the tables PEOPLE and PROPERTIES given below:

PEOPLE Name Phone PID Aisha 9411223344 1 Karan 9422114455 2 Rosy 9433112244 3

PROPERTIES PID SPID Farm_Name 1 1 Old house farm 3 2 Nanada’s farm 3 3 Will’s farm 3 4 Tall farm 4 5 The florist

With reference to these tables, write command in SQL for (i) and (iii) and output for (iii). (i) Display the name and phone number of each person who has a farm. (ii) Display the farm name of farm(s) owned by Karan. (iii) SELECT Name, Phone, Farm_Name

FROM PEOPLE right join PROPERTIES On PEOPLE.PID = PROPERTIES .PID;

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 36

Page 37: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) 426. Consider the following table Student. Write SQL commands for the statement

(i)–(v) and give the outputs for SQL queries (vi)-(vii). NO NAME STIPEND STREAM AVG.MARK GRADE CLASS

1 AMIT 400 Medical 78.5 B 12 B 2 SUMIT 450 Commerce 89.2 A 11 C 3 KUMAR 300 Commerce 68.6 C 12 C 4 AJEET 350 Humanities 73.1 B 12 C 5 SUJEET 500 NonMedical 90.6 A 11 A 6 DEEPAK 400 Medical 75.4 B 12 B 7 SANJAY 250 Humanities 64.4 C 11 A 8 KULDEEP 450 Nonmedical 88.5 A 12 A 9 MOHIT 500 Nonmedical 92.0 A 12 A 10 ARUN 300 Commerce 67.5 C 12 C

(i) Select all the contents of Nonmedical stream students from STUDENT. (ii) List the name of those students who are in class 12 sorted by stipend. (iii) List all details of students sorted by AvgMark in descending order. (iv) Display a report, listing name, stipend, stream and amount of stipend received in a

year assuming that stipend is paid every month. (v) To add a new column called Phone_no. (vi) SELECT COUNT(DISTINCT STREAM) FROM STUDENT; (vii) SELECT AVG(STIPEND) FROM STUDENT WHERE GRADE=”B”;

427. Given the following LAB relation: Write SQL command for questions (i) to (v) and the output for (vi) to (ix). No Item Name Cost Per Item Quantity Date of

Purchase Warranty Operational

1 Computer 60000 9 2006-05-21 2 7 2 Printer 15000 3 2007-05-21 4 2 3 Scanner 18000 1 2008-08-29 3 1 4 Camera 21000 2 2006-06-13 1 2 5 Hub 8000 1 2009-06-13 2 1 6 UPS 5000 5 2006-05-21 1 4 7 Plotter 25000 2 2010-01-11 2 2

(i) To select the Item Name purchased after 2007-10-31. (ii) To list the ItemName in ascending order of the date of purchase where quantity is

more than 3. (iii) To count the number of Items whose cost is more than 10000. (iv) Decrease the cost per item by 10% if the warranty is 1. (v) To insert a new record in the lab table with the following data:

8,’VCR’,10000,2,’2010-02-02’,1,2. (vi) SELECT MIN(DISTINCT QUANTITY) FROM LAB; (vii) SELECT MIN(WARRANTY) FROM LAB WHERE QUANTITY=2; (viii) SELECT SUM(COSTPERITEM) FROM LAB WHERE QUANTITY>2; (ix) SELECT AVG(COSTPERITEM)FROM LAB WHERE Warranty=2;

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 37

Page 38: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) 428. Given the following CREATE TABLE command, identify foreign key constraints

and their complete details. (i.e, the parent table, child table, field name, restriction etc.). CREATE TABLE lego_composer ( Construction int(11) NOT NULL, Brique int(11) NOT NULL, Nombre integer NOT NULL Default 1, CONSTRAINT Construction_composer FOREIGN KEY (construction) REFERENCES LEGO_CONSTRUCTION(id) ON DELETE RESTRICT ON UPDATE CASCADE, CONSTRAINT brique_composer FOREIGN KEY (brique) REFERENCES LEGO_BRIQUE(id) ON DELETE RESTRICT ON UPDATE CASCADE, PRIMARY KEY (Construction, Brique) );

429. Consider the table BUS given below:

Busno Origin Dest Rate KM Time Type 21 Del Jul 45.5 210 9.50 AC 198 Del Amrit NULL 250 10.00 NULL 101 Chandi Del 12.5 250 22.00 NON AC 49 Mum Pune 35.0 205 11.00 NON AC 12 Del Agra 50.0 330 6.00 AC 25 Del Hrdw 20.5 250 5.00 NON AC 24 Del Agra 25.0 330 8.30 NON AC

(a) Insert a new row in the table BUS with data: 22, Agra, Delhi, 50, 330, 14.00, AC

(b) Modify a row of Busno 198 by changing the Rate to 30 and type to ‘NON AC’. (c) Add a new column Tax_Charge number(6) with constraint NOT NULL to the table. (d) Display the starting and the destination stations together in one column. (e) Display the number of buses which start from Delhi before 10 am. (f) To display a report with busno, origin and destination for only those buses whose

time is between 11 am and 11 pm. (g) To display the origin along with sum of km for each origin.

Give the output of the following MySQL queries: (h) Select Busno, Type from BUS where dest in(‘Del’, ‘Agra’); (i) Select Busno, Origin, Dest from Bus where Dest like ‘A%’;

430. What will be the output of following code? (a) select round(-1.48); [Ans: -1] (b) select round(-1.66); [Ans: -2] (c) select round(3.456,1); [Ans: 3.5] (d) select round(2.198,0); [Ans: 2] (e) select round(156.456,-2); [Ans: 200] (f) select truncate(7.29,1); [Ans: 7.2] (g) select truncate(255.56,-2); [Ans: 200] (h) select char(65); [Ans: A] (i) select substr(‘welcome to ip’,-3,5); [Ans: ip] (j) select substr(‘welcome to ip’,5); [Ans: ome to ip] (k) select month(2011-10-24); [Ans: 10] (l) select dayname(2011-10-24); [Ans: Monday]

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 38

Page 39: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) 431. Consider the tables ‘DOCTOR’ and ‘SALARY’ given below. With reference to

these tables, Write commands in SQL for (a) and (d) and output for (e) below: DOCTOR

No NAME DEPT SEX EXPERIENCE

301 Raj ENT M 12

799 Rohan ORTHEPEDIC M 5

101 Maria CARDIOLOGY M 10

302 Mathew ENT F 3

SALARY No Basic Allowance Fees

101 12000 1000 300

799 23000 2300 400

301 32000 4000 500

302 12000 5200 100

(a) Display the average salary of all the doctors working in ”ENT” department. (where salary is sum of basic and allowance)

(b) Display the minimum allowance of female doctors. (c) Display the doctor no, doctor name and corresponding basic for each doctor. (d) Display the list of all doctors who charge fees less than 400. (e) Select NAME, BASIC, ALLOWANCE

FROM DOCTOR, SALARY WHERE FEES>=500 AND DOCTOR.NO=SALARY.NO;

432. Consider the following tables Item and Customer. Write SQL commands for the statements (i) to (iv) and give output for SQL queries (v) to (viii).

TABLE: ITEM I_ID ItemName Manufacturer Price

PC01 Personal Computer ABC 35000

LC05 Laptop ABC 55000

PC03 Personal Computer XYZ 32000

PC06 Personal Computer COMP 37000

LC03 Laptop PQR 57000 TABLE: CUSTOMER

C_ID CustomerName City I_ID

01 N Roy Delhi LC03

06 H Singh Mumbai PC03

12 R Pandey Delhi PC06

15 C Sharma Delhi LC03

16 K Agarwal Bangalore PC01

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 39

Page 40: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) (i) To display the details of those Customers whose City is Delhi. (ii) To display the details of Items whose Price is in the range of 35000 to 55000 (Both values included). (iii) To display the CustomerName, City from table Customer and ItemName and Price from table Item, with their corresponding matching I_ID (iv) To increase the Price of all Items by 1000 in the table Item. (v) SELECT DISTINCT City FROM Customer; (vi) SELECT ItemName, MAX(Price), Count(*) FROM Item GROUP BY ItemName; (vii) SELECT CustomerName, Manufacturer FROM Item, Customer WHERE Item.I_Id=Customer.I_Id; (viii) SELECT ItemName, Price * 100 FROM Item WHERE Manufacturer='ABC';

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 40

Page 41: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15)

UNIT-4 (IT Applications)

433. How does e-business improve customer satisfaction. Write one point. 434. Give one social impact of e-Business. 435. Write two advantages of e-Business sites. 436. What benefits does an e-Business offer to the customers? 437. Define e-Commerce? 438. What another name can be taken for e-Business? [Ans: e-Commerce] 439. How has today’s technology contributed to e-governance? 440. How has our society benefited from e-governance? Write two points. 441. Write three important features of e-Governance. Give URL of one of the

commonly used e-Governance portals. 442. What is the impact of e-learning sites on students learning process? 443. Write two advantages of e-Learning sites. 444. Name any two web portals with their purposes involved in e-Business, e-Learning

and e-Governance. 445. List two features of a good interface. 446. What is the purpose of comments and indentation in a program? 447. Define front-end of an information system. 448. Name any two GUI which can be used as front-end. 449. What do you understand by the back-end of an information system? 450. Name two back-end databases. 451. How is a back end linked to a database and a server? 452. What is Data connectivity? 453. Name the Java database connectivity library for MySQL database. 454. Define what is meant by an entity and relationship. 455. Define an attribute. What is a key attribute? 456. Why do you need to create table in database? Write the essential attributes for a

student table. 457. Depict the relationship between an employee who can report to more than one

manager. Also write what kind of relationship is this. 458. Identify the type of relationship from the following and also show them

diagrammatically, ‘A School consists of a number of specialized Departments.’ 459. Vijay works for the school. He wishes to create controls on a form for the

following functions. Choose appropriate controls from Text Field, Text Area, Label, Option Button, Check Box, List Box, Combo Box, Button. S.No Control used to Control 1 Enter Admission No 2 Enter last name 3 Enter Gender 4 Choose subjects from list of

subjects

5 Submit form 6 Select stream 7 Clear the form 8 Enter Remarks 9 Display some information

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 41

Page 42: Informatics Practices - kvhaldwani.orgkvhaldwani.org/ip/IP Question Booklet.pdf · Informatics Practices, Class XII (2014-15) Informatics Practices Class XII MISSION 2015 Blue Print

Informatics Practices, Class XII (2014-15) 460. What controls would you suggest for following types of inputs?

(i) typed text (multiple lines) [Ans: Text Area] (ii) typed text (single line) [Ans: Text Field] (iii) a mouse click [Ans: Radio Button/ Button/ Check Box] (iv) one out of many choices [Ans: Radio Button] (v) multiple choices from a set [Ans: Check Box/ List Box ] (vi) multiples items from a group of names [Ans: List Box (vii) typed text which should remain hidden [Ans: Password Box]

Mohd. Hashim, PGT (Computer Sc.), E-mail: [email protected] 7417786626 42