You are on page 1of 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 1

1

1

1

1 1

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

2

2

b=5. if(a>5) if(b>5){ System.i++.7. int i=1.5.println(“Hello\n”). } 15: Rewrite the following code and underline the errors (if any) : int m=1. } i=i+1. (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. for(. 2 . } 17: Predict the output of following code fragment: int i.println(“a is ”+a).out.out.5. 2 1 1 1 (a) (b) (c) (d) Add Numbers when ‘+’ button is clicked. 14: Predict the value of n. n=0.j=0. 16: Show the output of following code: (a) int a=5. do{ n++.j++){ n+=1. } while(i<=5).i=1.10.0.print(“The Limit”). 20: Develop a simple calculator as per following needs: 1 2 1 (b) int a=10.j<=i.m+n<19. } else{ System.println(“b is”+b).out. 18: Write for loop to print 10 times Hello 19: Write code to print the following series upto 10 terms 3.} else System.n=0. Subtract Numbers when ‘-’ button is clicked Clear all text field when ‘C’ button is clicked Close application when off is clicked 2 21: Develop a compound interest calculator.n. while(i<4){ for(j=1.j..++n) System. if(a>5){ if(b>5) System. Display result in ResultTF.print(“a is ”+a).println(“b is”+b).out.System.b=10. m=m+10.out.14.out.n=0.0 ….

(l) Write a query to display employee number. (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. 2 1 1 1/2 1/2 26: Based on the table above answer the following questions (a) Write a query to display employee’s name. (i) Display the distinct job titles offered by the Organization. (b) Write a query to display all the records with all the columns. 2 (a) Wage rate are Rs150(per day) for male and Rs 130 for female. (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. 5% to “Silver” Card. (h) Write a query to display details of employs with the text “Not given”. (b) Write the command to round off value 15. (f) Write a query to display the name of employee whose name contains“A” as third alphabet in Ascending order of employee names. 1 1 1 1 1 1 1 1 1 1 1 1 1 . name. (k) Display the names of employees who joined on or after 01/05/1991.e. 10% Discount is given to “Platinum” Card . (e) Write a query to display employee name and salary of those employees who don’t have their salary in range of 2500 to 4000. 20 (c) Calculate √ . if commission is null. (d) Calculate 10+6. (m) List the detail of employees who have 4 lettered name.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.salary and sal*12 as annual salary whose are getting commission. salary and current date.193 to nearest ten’s i. 8% to “Gold” Card. (g) Write a query to display the ename and sal with 50% of sal as DA. 24: Develop Application To calculate wage as per following specification. (j) Display the Names of employees who are working as Manager or Analyst.

4 64.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.2) from club where dateofapp>’1998-01-31’. Select right(stream.5 89. (h) Modify the column CustCity as change the size 40 characters long.00 500. 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.’ with CustName. (b) Display how many years have passed from the day of appointment of each coach.2) from Student. (a) Select substr(coachnaame.5) from club where sex=’F’.00 500. Select concat(name. Select round(avgmark) from student where grade=’B’.00 350.stream) from student where class=’12A’. (g) Drop the column CustomerIncomeGroup from table Customer.5 92.00 300.0 67. 1 . (c) Select mod(age. Also make CustNo as Foreign Key which refers CustID of CUSTOMER table 1 1 1 1 1 1 1 1 2 (k) Delete primary key of ORD table.00 300. (i) Delete all the records who belongs to ‘Jaipur’ (j) Create table ORD as per following Table structure. 1 (b) Insert following records in the Customer table. (f) Add one more column CustIncomeGroup of data type VARCHAR(10).1.00 450.00 Stream Medical COMMERCE COMMERCE HUMANITIES NONMEDICAL MEDICAL HUMANITIES NONMEDICAL NONMEDICAL COMMERCE AvgMark 78. (e) Add one column Email of data type VARCHAR and size 30 to tableCustomer.4 88.6 75.1 90.00 400.00 450.2 68.6 73.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.00 250. answer following sql statements. 1221 John Sec10 Ambala +919999999999 1118 Smith Sec17 Kurukshetra +910000000000 (c) Show structure of Customer table (d) Update all the records as add ‘Mr. 29: Write SQL queries for following (a) Create table CUSTOMER as per following Table structure.