Sie sind auf Seite 1von 4

Manish Papneja Memorial Public School, Ismailabad (KKR) Term II Examination December 2012 Subject- Informatics Class-XI Time:

: 3 hours Instructions: a) Attempt all questions. b) Answers the questions after carefully reading the text.
1: Which of the following are valid identifiers: (a) Data_rec (b)1data 2: Name any 4 keywords. 3: Find output of following statement. (a) System.out.print(5/3); (b) int k=20; int j=--k+2*k; System.out.print(j); 4: Write java expression to round 18.1932 till 2 decimal places 5: What will be resultant data type of following expression fl+(int)db 6: Find the value of y. float x=4.3f; float y=x+(int)x/2; 7: Calculate the result of following expression. Assume x=7,y=6 and z=5 (x>y)&&(!y<z) 8: Find value of bonus. Assume n=500. bonus=n+sales>1500?100:50; 9: Declare a constant GOODS_TAX=0.03; 10: Rewrite the following fragment using switch: If(ch==E) e++; if(ch==W) w++; if(ch==N) n++; else unknown++; 11: How many times following loops executed? (a) x=5;y=50; while(x<=y){ x=y/x; } 12: Rewrite the following code using do..while loop. i=100; while(i>0) System.out.print(i--); JOptionPane.showMessageDialog(null,ThankYou); 13: Find Output of following code if s=20 If(s<20) System.out.print(Under); else System.out.print(Over);

M.M:70

1 1

1 1

2 (b) int m=10,n=7; while(m%n>=0){ m=m+1; n=n+2; .. }

System.out.print(The Limit); 14: Predict the value of n. int i=1,j=0,n=0; while(i<4){ for(j=1;j<=i;j++){ n+=1; } i=i+1; } 15: Rewrite the following code and underline the errors (if any) : int m=1,n=0; for(;m+n<19;++n) System.out.println(Hello\n); m=m+10; 16: Show the output of following code: (a) int a=5,b=10; if(a>5) if(b>5){ System.out.println(b is+b); } else{ System.out.println(a is +a); } 17: Predict the output of following code fragment: int i,j,n; n=0;i=1; do{ n++;i++; } while(i<=5); 18: Write for loop to print 10 times Hello 19: Write code to print the following series upto 10 terms 3.5,7.0,10.5,14.0 .. 20: Develop a simple calculator as per following needs:

(b) int a=10, b=5; if(a>5){ if(b>5) System.out.println(b is+b);} else System.out.print(a is +a);

1 1

(a) (b) (c) (d)

Add Numbers when + button is clicked. Display result in ResultTF. Subtract Numbers when - button is clicked Clear all text field when C button is clicked Close application when off is clicked

21: Develop a compound interest calculator.

(a) Amount=Principal(1+Rate/100)^T (b) Interest=Amount-Principal 22: Develop an application to calculate amount based on weight of goods and travelling distance.

The Amount to be calculated as per rates given below: Distance Weight >=500 KM >=100 KG >=10 and <100 KG <10 KG <500 KM >=100 KG <100 KG

2 Charge Per KM Rs 5/Rs 6/Rs 7/Rs 6/Rs 8/-

23: Develop application to calculate discount depending upon type of membership.

10% Discount is given to Platinum Card , 8% to Gold Card, 5% to Silver Card. 24: Develop Application To calculate wage as per following specification.

(a) Wage rate are Rs150(per day) for male and Rs 130 for female. (b) An additional amount Rs50 is given if person is skilled 25: (a) Write command to print the day of the week of your birthday in the year 2015. (b) Write the command to round off value 15.193 to nearest tens i.e. 20 (c) Calculate . (d) Calculate 10+6.

2 1 1 1/2 1/2

26: Based on the table above answer the following questions (a) Write a query to display employees name, salary and current date. (b) Write a query to display all the records with all the columns. (c) Write a query to display EmpName and Sal of employees whose salary are greater than or equal to 2200 (d) Write a query to display details of employs who are not getting commission. (e) Write a query to display employee name and salary of those employees who dont have their salary in range of 2500 to 4000. (f) Write a query to display the name of employee whose name containsA as third alphabet in Ascending order of employee names. (g) Write a query to display the ename and sal with 50% of sal as DA. (h) Write a query to display details of employs with the text Not given, if commission is null. (i) Display the distinct job titles offered by the Organization. (j) Display the Names of employees who are working as Manager or Analyst. (k) Display the names of employees who joined on or after 01/05/1991. (l) Write a query to display employee number, name,salary and sal*12 as annual salary whose are getting commission. (m) List the detail of employees who have 4 lettered name.

1 1 1 1 1 1 1 1 1 1 1 1 1

coach_id

coachname

Table : Club age sports


35 34 34 33 36 36 39 37 41 37 KARATE KARATE SQUASH BASKETBALL SWIMMING SWIMMING SQUASH KARATE SWIMMING BASKETBALL

dateofapp
1996-03-27 1998-01-20 1998-02-19 1998-01-01 1998-01-12 1998-02-24 1998-02-20 1998-02-22 1998-01-13 1998-02-19

pay
1000 1200 2000 1500 750 800 2200 1100 900 1700

sex
M F M M M F F F M M

1 KUKREJA 2 RAVINA 3 KARAN 4 TARUN 5 ZUBIN 6 KETAKI 7 ANKITA 8 ZAREEN 9 KUSH 10 SHAILYA 27: Based on table CLUB, answer following sql statements.

(a) Select substr(coachnaame,1,2) from club where dateofapp>1998-01-31. (b) Display how many years have passed from the day of appointment of each coach. (c) Select mod(age,5) from club where sex=F. 28: Given the following table Student:

1 1 1

StudentID
1 2 3 4 5 6 7 8 9 10 (a) (b) (c) (d)

Name
Karan DIVAKAR DIVYA ARUN SABINA JOHN ROBERT RUBINA VIKAS MOHAN

Stipend
400.00 450.00 300.00 350.00 500.00 400.00 250.00 450.00 500.00 300.00

Stream
Medical COMMERCE COMMERCE HUMANITIES NONMEDICAL MEDICAL HUMANITIES NONMEDICAL NONMEDICAL COMMERCE

AvgMark
78.5 89.2 68.6 73.1 90.6 75.4 64.4 88.5 92.0 67.5

Grade
B A C B A B C A A C

Class
12B 11C 12C 12C 11A 12B 11A 12A 12A 12C 1 1 1 1

Select truncate(avgmark) from student where avgmark<75; Select round(avgmark) from student where grade=B; Select concat(name,stream) from student where class=12A; Select right(stream,2) from Student.

29: Write SQL queries for following (a) Create table CUSTOMER as per following Table structure. 1

(b) Insert following records in the Customer table. 1221 John Sec10 Ambala +919999999999 1118 Smith Sec17 Kurukshetra +910000000000 (c) Show structure of Customer table (d) Update all the records as add Mr. with CustName. (e) Add one column Email of data type VARCHAR and size 30 to tableCustomer. (f) Add one more column CustIncomeGroup of data type VARCHAR(10). (g) Drop the column CustomerIncomeGroup from table Customer. (h) Modify the column CustCity as change the size 40 characters long. (i) Delete all the records who belongs to Jaipur (j) Create table ORD as per following Table structure. Also make CustNo as Foreign Key which refers CustID of CUSTOMER table

1 1 1 1 1 1 1 2

(k) Delete primary key of ORD table.