Vous êtes sur la page 1sur 14

Practice Paper of

Informatics
Practices (065) for
XII Board Exam
2014

Delhi Public School, Ranchi


SAI L Tow ns hip
Ranchi 834 004
+91-9470932544 (Cell)
+91-9097536204 (Off)
1/3/2014

Developed & Designed by


DR. SRIKUMAR MUKHERJEE
(Teacher, Dept. of Computers,
DPS, Ranchi)

Systematic organization of habits and


instincts with purpose of fulfilling the
becoming of life, by graduated active
manipulation of behavior may be called
Education. [NP Vol-3]

Instructions for using this practice paper and preparation for writings of the answers:
This is designed according to the text book taught in the class.
First read / browse a chapter then go through the questions to find the answer of this paper.
Page wise, chapter wise, important questions have been prepared.
After ending each chapter also find the questions given at the end of the chapter.
Finally also take help form the sample paper of the market.
What to do in the examination hall?
Just after getting the question paper, take couple of deep breaths concentrating your mind.
Read the question paper properly, and make a plan to answer.
As far as possible attempt the questions in the serial order.
Theory answers must not be unnecessarily too long, it must be precise and to the point.
Theory based programming answers of Qs 1, 2 & 3 should have example(s).
Example is must, even it is not asked.
Outputs must be written just as it is viewed in console-display. Be careful of error findings & outputs.
Error finding must be Re-written in the form of full corrected program with underlined the corrected
places of the corrected re-written program and commenting on the errors.
Draw Line of Separation end of each answer by dark PENCIL and keep 1-2 lines gap, before you
start to answer the next question in the examination hall.
Don't waste the time for the question about which you are in doubt.
Complete your all answers within 2hrs 15min and use rest 35-40 min to revise your papers.
Before leaving Exam Hall do RE-CHECK all the answer papers properly within 5 min.
.

[Question# 1]

NETWORKING & OPEN SOURCE SOFTWARE

[TOTAL MARKS 10]

(1) Define / Make a short note of the followings (Computer Networking):


[1-2 / 2-3 marks of each]
(a) Computer Network (b) PAN, LAN , MAN, WAN, (c) Node , Server , Hub , Workstation, TAP , NIU (d) Ring Topology , Star
Topology , Tree Topology , Bus Topology, Mesh Topology (e) Data Communication (f) Twist Pair Cable , Coaxial cable,
Optical fiber cable, Ethernet cable (g) Wireless Networking (h) Microwave, Radio wave, Satellite, (i) Infrared Communication (j)
Bluetooth , WiFi (k) Modem , Hub , Ethernet card, Repeater , Bridge , Gateway , Router (l) IP address , MAC address ,
Domain name (m) Define: 023.876.067.002 , www.indoaryan.org , URL (n) Differentiate: Domain Name & URL (o) .org ,
.com , .edu , .net , .gov (p) Network security , Threat to Network (q) Firewall , IDS , Snooping , Danial of Service Attack or
DoS Attack (r) SYN Fooding , Pentium F00F Bug , Ping Flooding , TearDrop / New Tear (s) HTTP , HTML , FTP , TCP/IP ,
SMTP
(2) Excel Industries has set up its new center at Lucknow for its office and web based activities. The company
compound has four building as shown in the diagram below :
The distance between various buildings
are :
KGN to Sri Ram
65m

Sa i
Bu ild ing

Sri Ra m
Bu ild ing

KGN
Building

Krishna
Building

Sri Ram to Sai


Sai to Krishna

195m
205m

Krishna to KGN
KGN to Sai

200m
195m

Sri Ram to Krishnal

325m

(g1) Suggest the cable layout of connections between the buildings.


(g2) Suggest the most suitable place to house the server, with a
Number of computers are :
suitable reason.
KGN Building
158
(g3) Suggest the placement of the following devices with reasons :
i) Repeater
ii) Hub Switch
Krishna Building
125
(g4) The Institute is planning to link its International office situated in
Sai Building
200
New Delhi. Suggest the best wired communication link with a very
Sri Ram Building
78
high speed connectivity from the following :
i) Telephone Analog Line ii) Ethernet Cable
iii) Optical Fiber
A company in Micro Excel has 4 wings of buildings as shown in the diagram:

W1

W2

W3

W4

Center to center distances


between various Buildings:
W3 to W1
50m
W1 to W2
60m
W2 to W4
25m
W4 to W3
170m
W3 to W2
125m
W1 to w4
90m
Number of computers in
each of the wing:
W1
150
W2
15
W3
15
W4
25

Computers in each wing are net worked but wings are not networked. The company has now decided to connect the wings also.

i) Suggest a most suitable cable layout of the connection between the wings.
ii) Suggest the most suitable wing to house the server of this company with a suitable reason.
iii) Suggest the placement of the following devices with justification:
1) Router
2) Switch / Hub
iv) The company is planning to link its head office situated in India with the offices at Reliance. Suggest an economic way to
connect it; the company is ready to compromise on the speed of connectivity. Justify your answer.
(3) Short answer type question:
[2 or 3 marks for each]
1) Which protocol is used to move Hyper Text document and simple file transferring through networks in wide area scale?
2) Which protocol will you use to transfer a file from the remote location?
3) Which transmission medium should be used to transfer data across two continents at very high speed?
4) How can you increase to signals between two networks if it is going down?
5) How the Indian languages are getting included in the application of computers easily? Name four such languages.
6) How do the web address is practically used in the net? Write the format of the same.
7) Is there any difference between an IP address (i.e. 239.004.994.010) and web address (i.e. www.indoaryan.org)?
8) Arrange the followings in ascending order according to their data transmission rate.
9) Sujata had some confusion between Domain name and URL. How do make her understand about the differences?
10) Which of the following is not a characteristic of Open Source Software: (i) There is a company owner (ii) Can be
downloaded freely (iii) Source code is available for modification.
11) There is a group presentation of two professors with their Palm Tops connected through Bluetooth. Which of the
following networks they are using: W AN LAN PAN MAN
12) How do you differentiate the OSS and Proprietary software in terms of customizability of the software?
13) Arrange the following communication channels in ascending order of their data transmission rates. ETHERNET
CABLE, OPTICAL FIBER, TELEPHONE CABLE, COAXIAL CABLE.

14) Which of the following softwares are open source: LINUX, MS WINDOWS 7, PHOTOSHOP, MYSQL
(4) Define / Make a short note of the followings (OSS):
[1-2 / 2-3 marks of each]
(a) Free software, (b) Open source software, (c) Freeware, (d) Shareware, (e) Source code, (f) FLOSS, (b) FSF, (h) W3C, (i)
OSI, (j) GNU, (k) Tomcat, (l) MySQL, (m) Front-End & Back-End, (n) Pango, (o) PHP, (p) Open Office, (q) Python, (r)
Firmware, (s) UNICODE (t) ASCII code (u) Name 2 sites of OSS.

[ Question# 2 ]

Java (with IDE) + HTML & XML

[TOTAL MARKS 10]

(1)
a)
b)
c)
d)
e)
f)

Explain How and when do you use getText() & setText() methods?
Differentiate of its applications: isEditable() & isEnabled()
Write the use of valueOf() method and output of the statement: float x=999.101 ; jLabel1.setText(String.valueOf(x));
Write the function of toString() method.
What is a wrapper class? Explain the following in terms of wrapper class: String x=12345; int y=Integer.parseInt(x) ;
Why do you use import javax.swing.JOptionPane ? Describe the two applications of JOptionPane class of the package
javax.swing
g) Which swing components does javax.swing.JPanel container contain?
h) Write the application of the method getPassword() with a right example.
i) How do you insert single lined and multiple lines comments?
j) What are the members of Java Tokens?
k) Differentiate: (a) Identifiers & Keywords , (b) Primitive & Reference Datatype , (c) Local & Instance(object) variable , (d)
Logical & Relational operators, (e) \t & \n , (f) \b & \r , (g) / & % operators
l) Differentiate: (i) int x=10 & final int y=10; (ii) (int k=10) & (int k==10)
m) What is use of default in switch..case statement? When do you use break in switch..case?
n) What are pre and post increments? Can you explain pre & post decrement also with example?
o) What will happen if you run a break statement in for loop? When do you use for loop?
p) How do you differentiate the applications of: while and dowhile statements?
q) What are exit-control and entry-control looping statements? Explain with example.
r) In a Java application using Net Beans IDE, the user views the data on the Text Fields, he found that his name is
misspelled, now he wants to edit it, but cant. What was done by the programmer that does not allow the user to edit his
name?
s) How do you enable the jLabel1?
t) How do you insert values into the TextArea? Write the syntax in terms of inputing value of i: for(i=1;i<=10;i++)?
u) Rashmi in her desktop application wanted to show her friends names in the List Box and their city names in the Combo
Box. Which property of the List Box and Combo Box will she use to do her jobs?
v) When do you import javax.swing.DefaultListModel; & import javax.swing.DefaultComboBoxModel; ?
w) What is Panel Container? In which package does it stay?
x) When do you use Check Box and Radio Button? Establish the relation between the use/application of Radio Button and
Combo Box.
y) Differentiate: (i) String x = (String) jList1.getSelectedValue() & String x = (String) jComboBox1.getSelectedItem() (ii)
isSelected() & setSelected() (iii) Text1.setForeground() & Text1.setFont() (iv) getText() & setText() (v)
getSelectedIndex() & getSelectedValue() (vi) addElement() & insertElementAt() (vii) removeAllElements() &
removeElementAt() (viii) remove() & clear() (xi) getModel() & setModel() (x) isEnabled() & setEnabled() (xi)
JOptionPane.MessageDialog( ) and JOptionPane.InputDialog( )
z) What is swing control? (Z.1) Write the output of x in the following case:> int x = (5>=8) ? 1 : 2;
aa)What is ButtonGroup? How does it effect to select a Radio Button?
bb)How does the Model contain the data to be taken from a list of data?
cc) What is the concept of OOP in terms of Class and Object? Write the syntax of the object creation.
dd)Object of which class do you create when you are working with inheritance? Write the advantages of inheritance.
ee)How many times the following loops will run? Which one of these is entry control and which one is exit control? Show the
outputs:
(A) int s=0 ; i=4 ; do { s+=i ; i++ ; } while (i<5) ; System.out.print( +s);
(B) int s=0 ; i=4 ; while(i<5) { s+=I ; i++ ; } System.out.print( +s);
ff) What are the final values of:
(A) int x ; int y=1 ; for(x=0 ; x<10 ; ++x) y = x++ ; - -y ; System.out.println(Value of x & y=> + x + + y;
(B) int a=2; int b=3; do{++b + b++; a++; a=++a ;} while(b<=12) ;System.out.println(Value of a & b=> + a + + b;
gg) What are ODBC and JDBC ?
hh) Write down the steps to create Menu & Sub-Menu. (FILE -> Open -> main.exe)
ii) What is purpose of user defined method? How do you pass parameters/arguments to a method?
jj) Explain methods call by value and call by reference .
kk) When a called method is called as void type and other data types? What do you understand value returned?
ll) Explain scope of variables in terms of Local and Global variables.
mm)
Write a function that will take length and breadth of a rectangle as parameters and return the area of the rectangle.
nn) Write the use & Output of the following STRING Library Functions:
(1) contact( )
(2) Length( )
(3) substring( )
(4) toLowerCase()
(5) toUpperCase()
(6) Trim()
(7) String x=Indoaryan ; String y=Existentialism ; x=x.contact(y) ; System.out.print( +x) ;
oo) Write the use & Output of the following Library Functions from MATH class:
(1) Math.sqrt()
(2) Math.abs()
(3) Math.cell()
(4) Math.pow()
(5) Math.round()
(6) Math.max()
(7) Math.min()
(8) Math.floor(12.7)
(9) Math.pow(2,3)
(10) Math.sin(30)
(11) Math.round(78.678)
pp)What is the use of new operator during creation of an object (instantination) of a class?
qq)What is a class? Explain the function of a constructor in a class?
rr) How does an inherited class use the parent class?
ss) How many kinds of Parent and Child class relationships can you mention?
tt) How do private , public , protected & default accessibility of variables and methods of a class can work?
uu)What is the use of an object? How do you call a method add() which is declared and defined in the child class?
vv) Differentiate: Method-Overloading and Method-Overriding with examples.

ww)
Radha created a method add() in a super class named myclass and she also made another method of the same
name [ add() ] declared in the child class yourclass of myclass. But while she runs the program, method of the parent
class does not run, but method of child class does run? What is the reason behind it? Can she run the method of the
super class? If yes then how?
xx) Satya created three methods of the same name Calc_Val() in a class and called the three methods one by one with
three different sets of parameters/arguments such as (int a) ; (int x, String k) & (double i, long j, char p). Will Satya get
success to run these three methods consecutively? If so explain how?
yy) What is an Abstract Class? How do you use it, explain with an example?
zz) Explain the interface of class with an example.
aaa)
Rathin has created a class, has no instantiation of objects (no objects created) and there is a method created inside
has no implementation and terminated with a semicolon ( ;) just after it defined. Now how Rathin does fill the gap of not
implementation of the method, by implementing the method in a sub-class (inherited) of the same?
bbb) What is Front-End Back-End connectivity? Write the application of JDBC and ODBC in 3Gl-4GL connectivity?
ccc) Write about JDBC-ODBC Bridge. What is JDBC Api?
ddd) How does JDBC driver work for MySQL?
eee) Write the statement (syntax) that makes driver loaded to establish connection between Java and MySQL?
fff) Write the statement (syntax) that makes the connection between Java and MySQL?
ggg) How can you run a SQL Command in a Java program, that is written for database connectivity?
hhh) Give the functions of: getConnection() , getDriver() , getLoginTimeout() , executeQuery() , executeUpdate() , first()
, previous() , getLong() , getRowCount() , setRowCount() , removeRow() .
(2) Write the answer of the following based on HTML & XML:
a) Write down the differences of HTML and XML.
b) Write mail 2 advantages of XML over HTML.
c) Expand the term HTML and its function.
d) Which tag in HTML will Subroto use place his photograph in the back ground of his web page? How will he use it?
e) What are the different four levels of HTML tags?
f) What is the file extention of a HTML code to be saved in a word processor? What type of file does it create?
g) What are the fundamental / document tags of HTML?
h) What are container tag and empty tag? Explain with examples.
i) Wrte the function of HEAD and TITLE tags.
j) Write the different elements / attributes of BODY tag.
k) Explain the function of the followings: BGCOLOR , BACKGROUND , TEXT , LINK , VLINK , ALINK
l) Write the differences of LEFTMARGINE and TOPMARGINE
m) Write the elements / attributes of FONT tag.
n) Write the functions of: FACE , COLOR , SIZE
o) What is BASEFONT?
p) Differentiate between <BASEFONT> and <FONT> tag?
q) How do you use the following tags? Give suitable examples to explain: (i) commsent (ii) paragraph (iii) center
r) Explain the uses of the following HTML text tags with example:
s) (a) <BR> (b) <P> (c) <B> (d) <I> (e) <U> (f) <STRIKE>
(g) <SUP>
(h) <SUB>
(i) <TT>
(j) <BIG> (k) <SMALL>
(l) <BIG>
(m) <STRONG> (n) <FORM>
(o) <METHOD> (p) <MAILTO>
(q) <RESET> (r) <SUBMIT> , <INPUT TYPE=submit VALUE=Submit Order> , <INPUT TYPE=Text>
,
2
t) How do you display H2SO4 & (A+B) in a HTML page?
u) What are the different levels of Heading tags? Give example.
v) Which of the tags : <H6> or <H1> gives a bigger size heading?
w) What is <HR> tag? Write the different elements/attributes of HR tag.
x) What are uses of the followig in terms of HR tag: ALIGN , NOSHADE , WIDTH (in Number) , W IDTH (in %age).
y) Answer the following in terms of LIST tags:
(a) <UL> (b) <OL>
(c) <LI> (d) <DT> (e) <DL>
(f) <DD>
(g) <DIR>
(h) <MENU>
z) What is the use of TYPE (A , a , I , i , 1 ) element in <OL> tag?
aa) What is the use of START element in <OL> tag?
bb) What are the different types of bulletes can be used in <OL> tag?
cc) What is use of VALUE element in <LI> tag?
dd) Explain with example nesting tag OR tags within tag?
ee) What is the HTML code for the following outputs (the Hyperlinks are indus.html & agre.html):

INDIA
1. Economy

INDIA
1. Economy

2. Education

Industry

3. Health

Agriculture

INDIA

INDIA
1. Economy

3. Economy

Industry

Industry

Agriculture

Agriculture

2. Education

4. Education

I. How do you insert an image in a web page? Write the HTML tag to display school.jpg.
II. IMG SRC is an empty or container tag?
III. What are the elements/attributes of <IMG SRC> tag?
IV. Write the most useful TWO attributes in <IMG SRC> tag?
V. What are the functions of: ALIGN , ALT , WIDTH , HEIGHT , BORDER elements in image tag?
VI. Explain the NAME attribute of anchor tag.
(3) Write the suitable HTML code to get the following outputs

a. Title of the page should be Global


Warming
b. Background colour should be
Yellow
c. Text font should be Dauphin
d. Image of the pollution is warming.gif
e. Pages are linked with :
The main page is home.htm
Water pollution page is water.htm
Soil pollution page is soil.htm
Biospare pullution is biospare.htm
Result page is result.html
Contact page is contact.html
f. Visited link colour be Blue and
Acti ve link colour be Red
h. Bottom message should be centre
aligned and the font size as 2

(4) Special Notes of the following Web Page :

a.
b.
c.
d.
e.
f.

g.
h.
i.

Title of the page is : Peoples Science Club


The background color of the page will be: SILVER.
Font face of the whole page will be: TOHAMA.
Logo used in the page on the top corner should be from a file Sclogo.gif
Text colour of the main heading should be: BLUE.
Pages Linked with:
Environment Awareness Environment.HTML
Health & Hygiene
Health_hygiene.HTML
Literacy Movement
Literacy.HTML
Model Exhibitions Modeling.HTML
Poster Exhibition Postering.HTML
Symposium
Symposium.HTML
The message Adapt Scientific Way Of Life To Be and Become!!! should be displayed in MAROON colour.
Link colour should be YELLOW, visited link will be GREEN and active link will be BLACK in colour.
The bottom message should be with size as 2.

(5)

Bharat Darshan
a.

Darshan
Kerala Dekho
Himachal Dekho

b.
c.

Background colour should be Yellow


Text font should be Dauphin

GOA Dekho
Rajasthan Dekho

d.

Image of the Indian map from the file


MapOfIndia.gif

e.

Pages are linked with :

Create your email ID on: www.theindianschoolonline.com

f.

Title of the page should be Bharat

(a) Kerala Dekho as Keral.htm


(b) Himachal Dekho as Him.htm
(c) GOA Dekho as Goa.htm
(d) Rajasthan Dekho as Raj.htm

g.
h.
i.

Visited link colour be Blue and


Active link colour be Red
Bottom message should be centre aligned and the font size as 2

[Question# 3]

RDBMS with MySQL

[TOTAL MARKS 10]

(1) RDBMS:
a) Define:

(a) Relation,
(b) Attribute or column,
(c) Touple or row,
(d) Field or Attribute
(e) Degree,
(f) Cardinality,
(g) Entity.
[1 - 2 marks for each]
b) Difine:
DDL , DCL , DML , TCL , Query command.
[1X5]
c) Define the following KEYs: FOREIGN KEY , PRIMARY KEY , CANDIDATE KEY , ALTERNATIVE KEY [1x4]
d) Describe different 3 types (1-1 , 1-many , many-many) of data relationships.
[3]
e) With diagram describe the different components of Database.
[3]
f) What are problems of Data Redundancy and Data Inconsistency?
[2]
g) What is Cartesian Product? Give example.
[1]
h) Define Data Models: Relational , Network , Hierarchical , Object Oriented
[3X2]
i) What will be value of the cardinality if you add 3 rows to a table of existing 5 records?
[1]
j) Draw and explain the relationship of: (a) One-to-one, (b) One-to-many, (b) Many-to-many.
[2]
k) What is client-server system? Explain 2-tyre and 3-tyre system.
[2]
l) In a query what is the use of _ _a% ?
[1]
m) How do you create a Foreign Key (REGNO) in table (CLASS) to make relationship with a Master/Parent table
(STUDENT)? Also write the basic factors to select a field as the Key field (Primary/Foreign).
[2]
n) Write the use of these constraints: NOT NULL , UNIQUE , CHEQUE , PRIMARY KEY , DEFAULT
[2]
o) What is joining of tables, write its types? What is Alias using queries on multiple tables? Give example. [3]
p) Write the uses of GROUP BY and ORDER BY clauses.
[2]
q) How can you restrict user to enter duplicate values in a field?
r) Differentiate: (i) ALTER & UPDATE tables
[2]
s) Differentiate: (i) Equi Join & Non-Equi Join
[2X2]
t) Define:
COMMIT
ROLLBACK
SAVEPOINT
[3]
u) What is group function? Give two examples.
v) How do you make any change permanent in Database?
w) Differentiate the uses of: DROP & DELETE.
2. Write the USE and OUTPUT of the following library functions (STRING , ARTHIMETICAL , DATE):
A. (i) CONCAT() (ii) INSTR() (iii) SUBSTR() (iv) LEFT() (v) RIGHT()
(vi) TRIM() (vii) LTRIM() / RTRIM()
B. (i) ROUND() (ii) POWER() / POW() (iii) TRUNCATE()
C. (i) DATE() (ii) CURDATE() (iii) NOW() (iv) YEAR() (v) DAYOFMONTH() (vi) MONTHNAME() (vii) MONTH()
(viii) DAYNAME() (ix) SYSDATE()

[Question# 4]
(1) NDPS offers two crash courses, one
in computers and the other in
Commerce. The students can avail
certain optional facilities. The Basic
Interface for accepting details of facilities
availed by a student are as given under:
Write the code and event methods for
incorporating the following functionality:
Assume that the charges for library,
mess and Transport are Rs. 500,
Rs.1200 and Rs. 1000 respectively.
Write a method that calculates (in
ButtonCalc) the charges per session (3
months), for the facilities availed
including registration fees Rs.500. Let
course fees for MCA and MBA per

Java (with IDE)

[TOTAL MARKS 15]

session are: 15000 and 20000 respectively.

[4]

(2) Read the following case study and answer the questions that follow:
ABC company has developed the following interface to enter the display data related to Income tax of employees. When the
form loads text boxes for income tax, Education tax , surcharge and total tax amount should be disabled. They should be
enabled only when calculate
command button is clicked. [2]
When the user clicks the clear
command button textboxes
empcode and empname should be
set of blank and textboxes be set
to zero.
[2]
When calculate command button
is clicked income tax, educational
tax, surcharge and total tax (sum
of income tax, education tax ,
surcharge) is displayed in their
respective text fields based on the
following criterion :[4]
Taxable income

Income tax

Education tax

Surcharge

Upto Rs. 100000

Nil

Nil

Nil

Rs. 100001 to 150000

10% of amount exceeding Rs. 100000

2% of taxable income

Nil

Rs. 150001 to 250000

Rs. 5000 + 20% of amount exceeding Rs. 150000

2% of taxable income

Nil

Rs 250001 and above

Rs. 25000 + 20% of amount exceeding Rs. 250000

2% of taxable income

1% of taxable income

(3) Here is a Students Entry Form. Here a student


shall enter his/her name and select sex, game and
branch and
Controls
Name
submit the
selected
jTextField
TextName
data. Now
jCheckBox
ChkBskt
answer the
ChkFoot
following
ChkSwim
questions
ChkHoky
using the
jRadioButton RadioBoy
control
RadioGirl
names:
(a) Write
jComboBox
CmbBranch
the code
for the
jButton
ButtonSubmit
EXIT
ButtonExit
button to
stop
running
the application.
[1]
(b) Write the code for SUBMIT button to take the values from different options and store 3 points to a variable pt if selected
sex is Female and branch is Humanities.
[4]
(4) Write the Java program as instructed below:
A Financer often needs to calculate the interest and
amount of his clients. He assigned his software
programmer to design a calculator which will
calculate the compound interest and amount due if a
person takes loan for 5,10 or 15 years. The
programmer opts for Net Beans IDE with Java to
develop the following form as the layout given:

Object
Radio
Button

Property
Opt5years
Opt10Years
Opt15Years

(a) Write the code to disable the textInterest in the Form Load event of
frmInterestCalc.

[1]

(b) Write the code for cmdClear Command Button to clear all the text boxes.
And set default choice in the Option Button as 5 Years. Also put the cursor

Text Field

Command
Button

TxtPrincipal
TxtRate
TxtInterest
TxtAmount
cmdCalculate
cmdClear
cmdExit

to the txtPrincipal.

[2]

(c) Write the code for the text boxes for the Principal and Rate entry to ensure
that the user enters only numeric values in them.
(d) Write the code for the click event of the command button to calculate the
compound interest and amount depending on the principal, rate and time.
[Compound Interest=> P * (1+r/100)^T Amount=> Principal + Compound Interest]

(5)
Ms. Sheela works in a shopping mall. To calculate net payable amount she has developed the following GUI in NetBeans. The
shop accepts payments in three modes- Cash, Debit Card, Credit Cards. The discount given as per mode of payment is as
follows- If the Member check box is checked then the customer gets an additional discount of 5% on net payable amount.
I. Write the code to make the textfields for Discount( txtDiscount ) and Net Payable (txtNetPayable) un-editable.
II. Write code to do the following-

Mode of payment
Cash
Debit Card

12%
Nil

Credit Card

8%

a)

b)
c)

Discount

When Calculate button is clicked the discount


and net payable amount is calculated as per
the given criteria and displayed in discount
and net payable text boxes.
When Clear button is clicked all the text boxes
should be clear.
Close the application when Exit button is
pressed.

(6) RE-WRITE THE PROGRAMS WITH CONVERSIONS:


a. Rewrite the following code segment using switch case
instead of if else:
[3]
int sal ;
if (sal <=10000)
System.out.print(New year bonus is 2000);
else if( (sal>=12000) && (sal <=15000))
System.out.print(New year bonus is 5000);
else if (sal=>20000)
System.out.print(New year bonus is 7000);
else
System.out.print(Bonus not applicable);

b. Convert the following without using a for loop: [3]


for( int j = 3; j>=1; j--)
{
if (x==1)
System.out.print (One);
else if (x==2)
System.out.print (Two);
else if (x==3)
System.out.print (Three);
}

c. Convert the following into a FOR loop:

d. Rewrite the following code segment using for loop


int total ; int n ; int I ;
n= Integer.parseInt(TextNo.getText());
while( i< = n)
{
total =total + I;
i=i+1;
}

int i=99;
do {
System.out.println(+ i+10) ;
i=i-3;
}
while (i<=33);

e. Rewrite following while loop into a for loop


int s=0;
while(s<=13)
{
if (s%2==2)
{
System.out.println(color code red);
}
else
{
System.out.println(color code blue); }
System.out.println(New color code );
s=s+1;
}

[3]

f. Rewrite following while loop into a for loop


int stripes =0;
while(stripes<=13)
{
if(stripes%2==2)
{ System.out.println(colour code red); }
else
{ System.out.println(colour code blue); }
System.out.println(new stripe);
stripes =stripes +1;
}

g. Rewrite following for loop into a while loop

h. Rewrite the following code using for loop.

int sum=0;
for(int i =1;i<=5;++i)
{
sum=sum+c;
}

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

(7) Write the OUTPUT of the following code segments:


(a)
(b)
Int compute(int x, int y)
{ //Assuming x>=0 and y>=0
If(x>=y)
{ x=x-y;
return compute(x,y) ; }
else
{ return x;}
}

(c) double Number = 7583241;


int Firsr = 0, Second = 0, R;
do
{
R = Number % 10;
if ( R % 2 == 0 )
First += R;
else
Second += R;
Number = Number / 10;
} while (Number > 0);
System.out.print(First Second );
---------------------------------------------------------------------(d)

int i, j, k;
for(i=1; i<=4; ++i)

[2 marks of the each qs.]


int x,y;
for(x=1;x<=4;x++)
{
for(y=1; y<=4;y++)
{
System.out.print(" "+x);
}
System.out.println();
}

(e)

String st="Comp9UtEr Scie7 nce";


char ch;
int i;
for(i=0;i<st.length();i++)
{
ch=st.charAt(i);
if(Character.isUpperCase(ch))
System.out.print(Character.toLowerCase(ch));
else
if(Character.isWhitespace(ch))
System.out.print("#");
else
if(Character.isDigit(ch))
System.out.print(" ");
else

{
for(k=1, j=I ; k<=I ; k++ , j+=2)
System.out.printl( ,+j);
System.out.println( );

System.out.print(Character.toUpperCase(ch));
}

}
(8) Find the ERRORS, Re-Write and Give the expected Output of the following questions:
(a)
(b)
switch(x)
Class one{
{
case 1 :
Private int count;
n1 =10 ;
}
n2 =20 ;
Class two{
case 2 :
Public static void main (String args[])
n3 =30 ;
{
one ob = new one();
break;
ob.count=10;}
n1 =40 ;
}
(d)
(c)
int m=100;
int f =1,i=2;
while(m>0)
while (++i <5)
{
f *=i;
if (m<10)
break;
System.out.println(f);
m=m-10;
} System.out.println(m is +m);
(e) Find the errors, if any
(f)
double i, sum=2 ;
int m=1;
for(i=3;i<8;++i)
int n=0;
{ if(i%4= =0)
for( ; m+n <19; ++n);
{ break;
System.out.println(Hello \n);
sum=Math.pow(sum,i);
m=m+10;
}
else
sum+=i/2;
}

(g)

int x=0;
for(i=1; i<10; i++)
{
for(int j=5; j>i ; j--)
{
System.put.print(The j is + j)
System.out.display(The i is + i);
}
X=i+j;
System.out.print(The x is + x)
}

(h)

int i=0;x=0;
while ( i < 10 )
{
{

if (i % 2 = 0)
x == x + i ;
System.out.print(x + 1);

}
i ++;
}

(9)
a)
b)
c)
d)

WRITE PROGRAM IN Java using Net Beans IDE:


[Marks 3 / 4 each]
Write a method that calculates the sum of all even numbers less that N
Write a method that takes an integer argument N and calculates the sum of all even numbers less that N
Write a method that takes 2 integer arguments N & A and returns the sum of powers of A up to Nth term. [S=A1+A2++ ANth term]
Write a method in a class (myclass) that takes integer values of N and A and return the sum of the powers of A up to Nth
1
2
N
term. [S=A +A ++ A th. term]
e) Write a method in a sub-class (yourclass) of the super class myclass that takes an integer value of N from the user and
calculates the sum of the odd numbers up to Nth term.
f) Write a method in a child-class (yourclass) of parent class myclass that takes integer arguments/parameter of N from the
caller method sum() through the object myobj , and return the sum of the odd numbers up to N and display the result.
g) Write a method (sum()) in a class myclass and pass object (myobj) of the class as argument/parameter from the caller
method , and return the sum of the odd numbers up to Nth term and display it after the caller method called.
h) Write a method pere()in a class which will take 2 parameters Length & Breadth as reference through object and find area.
i) Write a program to store your name into an Array and display character wise reading from the Array.
j) Write a program to store natural numbers into a double dimension Array and print the sum of the numbers row wise.
k) Write a method will take New value and position as parameter, which are of integer type, insert the new value in the
specified position in an array.
(l) Write a function Power to raise a number m to power n. The function takes two integer value and returns the result
correctly, Use default value of 2 for n (to calculate squares) if argument is omitted.
[3]
(m) A class Electbill contains consumer details and another class Bill calculates the monthly electricity bill of a consumer.
Details of the two classes are given below:
Class name
: Electbill
Data members/Instance variable
:
cno
: consumer number
name
: consumer name
add
: consumer address
Member functions :
Electbill(....) : Parameterised constructor to assign values to consumer number, consumer name and address
void display() :
Display consumers details
Class name
:
Bill
Data me mbers/Instance variable
:
n
: integer variable to store number of the units consumed
Member functions
:
Billl(....)
: Parameterised constructor to assign values to data members
void calculate()
:Calculate the monthly bill of consumer according to following slabs and it should also display the
consumers details and total amount to be paid.
Number of units consumed
Rate
1 - 100
Rs 500/-rental charges only
101 - 200
Rs 1.00 per call + rental charges
201 - 300
Rs 1.20 per call + rental charges
Above 300
Rs 1.50 per call + rental charges
(n) Specify the class Electbill giving details of constructor and member function void display().Using the concept of
Inheritance specify the class Bill giving details of constructor and member function void calculate()
(o) Write the programs of the following outputs:

(i)

#
# #
# # #

(ii)

* * *
* *
*

(iii)

@
@ @ @
@ @ @ @ @

(iv)

1
2 2 2
3 3 3 3 3
2 2 2
1

[Question# 5 & 6]

RDBMS with MySQL

[20]

(1) Write the SQL commands of the following Table(s)

[0.5 mark of each qs.]

Table: STUDENT
STDCODE
S009
S010
S012
S015
S020
S033
S052

NAME
AJAY MALHOTRA
KUSUM VIMANI
SARITA VERMA
KAILASH SINGH
SANJAY SRIVASTAVA
KAVITA SAXSENA
BIJAY MAJUMDAR

CLASS
11
12
12
10
11
9
12

SECTION
A
C
C
D
K
K
B

AVGMARK
86.55
79.85
98
78.45
85.45
66.50
88

DOB
12-DEC-1995
22-MAR-1994
23-JAN-1992
5-OCT-1993
10-MAY-1990
12-SEPT-1993
5-NOV-1989

Table : CLASS
STDCODE
S009
S010
S012
S013
S022
S033
S052

SECTION
A
C
C
D
L
K
B

ADDRESS
RANCHI
PATNA
TATA
DHANBAD
KOLKATA
SILLIGURI
BHUBANESWER

DOA
12-MAR-2001
20-MAR-1999
13-FEB-2000
15-JULY-1999
10-MAR-2002
5-MAY-2004
15-DEC-2003

(10.1)
a) Create the table Student, using constraints NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY, CHEQUE, DEFAULT
value RANCHI for Address in appropriate attributes/fields/columns.
b) Enter a new record: S009, Swapan Pal, 11, E, 80.5, 15-8-1991.
c) Re-arrange the records in descending and ascending order on Date of Birth.
d) Display the Name Class Age and Date Of Birth of the students who have either less then 80 Average Marks, or year of
birth before 1993.
e) Display the Name, Admission number and Date of Birth of those whose first character of name is K.
th
f) Display the Name, Admission number and Date of Birth of those where 7 latter of the address is A.
g) Display the Different Sections present in the table.
h) Display the Different Sections and their corresponding numbers present in the table.
i) Replace the Name Ajay Malhotra by Ajit Mahapatra.
j) Increase each of the Average Mark by 2.0.
k) Display number of records present in the table.
l) Display Numbers of each section in the table of those who got Average Marks more than 75.
m) Include a new column Address in the table.
n) Delete the same column.
o) Make the column Admission number as a Primary Key.
p) Remove the existing record(s) of all who are not from classes 11 or 12.
q) Display the Maximum Average Marks from each section.
r) Display the Minimum Average Marks from each section.
s) Display the Total Average Marks of the table.
t) Display the values of Name and Date of Birth close together (concatinate).
u) Show the Name and number of characters of each name.
v) Show the first character of each name as Capital.
w) Show the each of the names in capitals and small as well separately.
x) Locate position of the character A in each of the name.
y) Display rest of the blank characters of a described field by * .
z) Remove all of the blank spaces from name field.
aa) Display first 5 characters of each of the name.
bb) Convert the date value into character value and number value of year of birth after 1990.
cc) Find the Square root and Reminder of division by 3 of Average marks.
dd) Display the Power 3 of the Average Marks of the sections A.
ee) Make StdCode of the Student table as FOREIGN KEY in reference to the Parent table Teacher.
ff) Display Students Code , Name , Address , Average Marks , Date of Admission of the tables Teacher and Student.
gg) Display Name , Date of Admission , Date of Birth from the tables Student and Class using Allies of the Tables.
hh) Write commands to: (i) DROP the common field STDCODE of Class table. (ii) Now display Name, Date of Admission,
Average Marks and Address from the both of the tables Teacher & Student. (iii) Again ADD the column Dropped before.
(10.2)
a) Display Name, Class, Address and Date of Admission from tables STUDENT and CLASS have similar student code.
b) Display all the Sections and Date of Birth from above two tables.
c) Create a view MyClass using the columns Name, DOB, and AvgMark from Student.
(10.3) Write the OUTPUT of the following commands from the above table Student.
a) SELECT Name from STUDENT where AvgMark > (SELECT AvgMark from STUDENT where Class=11);
b) SELECT X.Name, X.Roll, Y.Address From STUDENT X, STUDENT Y where X.AdmNo=Y.AdmNo;
c) SELECT Addres from CLASS where Section IN (SELECT Section from STUDENT where Class>=11);
d) SELECT Count(*), DISTINCT(Section) from CLASS;
e) SELECT Count(*), Section from STUDENT Group By Section Having Class>=10;
f) SELECT (AvgMark * 0.5 from STUDENT where Name like S%;

g) SELECT MIN (AvgMark) from STUDENT; (g.1) SELECT MAX (AvgMark) from STUDENT;
h) SELECT SUM (AvgMark) from STUDENT where DOB > 1990-12-13 AND DOB < 1995-1-1;
i) SELECT StdCode, Section from Student UNION SELECT StdCode, Section from Class;
j) UPDATE Class Set Address=Ranchi Where StdCode =(Select StdCode From Student Where DOB=1993-10-15);
NB: You must also go through the Solved Exercises of the chapter Review of SQL.
11. Answer the questions based on the table HOSPITAL given below:
[16X1=16]
Table: HOSPITAL
Column Name
Data type
Size
Constraint
Ptnt_No
Number
4
Primary Key
Ptnt_Name
Varchar2
15
Not Null
Dept
Varchar2
15
----Doc_Name
Varchar2
15
Not Null
Dt_Birth
Date
------Fees
Number
6,2
Default 00.00
Ptnt_Phno
Number
12
Check <=12
a) Write the SQL command to create the table Hospital including its constraints.
st
b) Write the SQL command to display the details of all the patients whose date of birth is after 1 January 2000.
c) Write the SQL command to display the type of Departments.
d) Write the SQL command to display the number of patients in each department for the names starts by character S.
e) Write the SQL command to increase the consultation fees by Rs 50.00 for the patients whose year of birth is before 1950.
f) Write the SQL command to change the length of the field Dept by 12.
g) Write the SQL command to display the Name of the Patients, corresponding Departments and Date of Birth, in
alphabetical order of the names of the patients.
h) Write the SQL command to remove a record of the Patient No 104.
i) Write the SQL command to remove the table.
j) Write the SQL command to Include a new attribute Srlno [Number(3)] to the table.
k) Write the SQL command to add Constraints NOT NULL & UNIQUE to Patient No.
l) Write the SQL command to display the first 5 characters of the patients name, who are from the department SURGERY.
m) Write the SQL command to display the total amount of fees collected.
n) Write the SQL command to display the oldest patients date of birth.
o) Write the SQL command to enter new record as per your choice to the corresponding attributes.
p) Write the SQL command to enter data to the attributes Department, Doctors and Patients Name
q) Write the SQL command to Discard / Undo the latest changes made in the table.
a) Categorize the DDL and DML commands :
CREATE, TRUNCATE, DELETE, GRANT, ROLLBACK, SELECT , COMMIT , ALTER
b) Write the output of the following SQL queries using library functions :
1) SELECT TRUNCATE(22.78,1);
2) SELECT DAYOFMONTH(2010-10-17) , MONTH(Sysdate());
3) SELECT DAYOFWEEK(CurDate());
4) SELECT SUBSTR(Common Wealth Games 2010,8,6);
5) SELECT CONCAT(LOWER(Class),UPPER(xii));
6) SELECT INSTR ( TRIM( Indoaryan , A);
7) SELECT LEFT(To the power of , 12) , POWER(5,3);
8) SELECT RIGHT(To the power of , 8) , POW(5,3);
9) SELECT ROUND(544.4583 , -2);
10) SELECT 15 / 4 , 15 * 2 , 15 + 5 ;
12. Consider another new table DEPARTMENT along with the table TEACHER having the fields: Srlno NUMBER(3),
Ptnt_No NUMBER(4), Deptname VARCHAR2(15), Address DATE. Now read the questions carefully and write the
SQL Commands of the followings.
[2X2=4]
(a) Display the Department, Name and Address from the above tables (Hospital and Department).
(b) Display the records from both of the tables even those have no common records.

[Question# 7]

IT Application

[05]

14.
a) What benefit does an e-Business offers to the customers?
b) How e-Learning is being benefited to the student class?
c) How has society benefited from e-Governance?
d) What are good interface?
e) How do the connection between Front End and Back End work together in the application of IT?
f) Explain the application of the following in real life project on : (i) e-Governance (ii) e-Learning (iii) e-Business
g) Mr. Anand is working as a Planning Manager in Zoom Tech. He wants to create the forms with the following functions. Choos e
appropriate cont rols from Text Field, Label, Radio Button, Check Box, List Box, Panel, Combo Box, Command Button, Text
Area and write in the third column.

SNo
1
2
3
4
5
6
7

Control Used to
Enter Name of Customer
Enter Mobile No.
Select Connection Type
Display the list of Items to be selected
Display total Amount of Bill
Display Name of all Customers with corres ponding Items month wise
Insertion of a frame for group selection.

Control

COLLECT the Question and Answer papers of Sem-II and Pre-Board Exams and critically read and

understand it ; which were already distributed to you. For further you are free to contact...

The laws of total development of individual and society are Concentricity, Self elevation and
Eugenics i.e. Ideal centric go-of-life, Accordingly self-manipulation and Bio-psychic compatible
marriage; lets uphold it
Hope we will be in touch for longer time, from any corner of the globe, I do wish - be a person with your evolving qualities and
efficiencies for your greater surroundings. Yours own forever S.M.
Developed and Designed by:

Dr. Srikumar Mukherjee, Dept. of Computers, Delhi Public School, Ranchi


Email:

srikumar2005_ranchi@yahoo.co.in

seeence@gmail.com

Ph # +91-9470932544 / 909753620 (Mob)

To upgrade the quality of thought do visit:

www.indoaryan.org

Vous aimerez peut-être aussi