Monday, 23 September 2013

test1



1)Design a GUI application to calculate the monthly telephone bills as per the following rule:
Minimum Rs. 200 for upto 100 calls.
Plus Rs. 0.60 per call for next 50 calls.
Plus Rs. 0.50 per call for next 50 calls.
Plus Rs. 0.40 per call for any call beyond 200 calls.
2) Design a gui application that repeatdely accepts number in a an option pane and once the number typed is 0, the maximum and minimum number is displayed
3)Convert the following ‘while loop’ into its equivalent ‘for loop without altering the output
int x = 100, a = 30;
while ( x>= 10)
{ System.out.println(”New Amount =”+(x + a));
a++;
x - = a;}
4)Write a program to swap value of two variables .
 5)ava code that takes a number from jTextField1 and displayed its table in jTextArea1.                    (e.g 6*1 . 6*2=12..uptil 6*10
6)What is the difference between setEnabled and setVisible methods of a control?
7)Predict Output:for a=15 and a=20
if(a%4==0)
if(a%5==0)
System.out.println(a);
else
System.out.print(a++);
else
 System.out.print(a+2);
8)char ch;Short sh;Int intval;long longval; float fl;
identify the datatype of the following expressions:
‘a’-3;
Intval*longval-ch;
Fl+longval/sh;
9)State the output of the following program:
public static void main(String args[ ])
{int x = 10;
double y = 10.0;
System.ou.println((x>y)? true: false);}
10 Give the output of the following statements.                                                                                        
jTextField1.setText(“CBSE\nFinal\tExam”);
11Differentiate between executeUpdate() and executeQuery();
12 What are the steps to connect to a database with a java application?
13. What is database connectivity? How is database connectivity useful?
14 Explain the purpose of following methods:
a) next() b)getModel() c)getRowcount() d)removeRow()
15What is the purpose of the class ResultSet?
16 Given a string object names salary having value as ‘55000” stored in it .,Obtain the output of the following:
a)JOptionPane.showMessageDialog(null,” “+salary.length()+Integer.parseInt(salary));
b) JOptionPane.showMessageDialog(null,salary.length()+Integer.parseInt(salary));
17Ms. Sunita has developed a Java application through which the students of her school can view their
marks by entering their admission number. The marks are 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?                        
19What will be values of x and y  after execution of the following code : int x, y = 0;
                 for( x= 1; x<=5; ++x)
                  y=x++;
                  --y;
20Which Command is used in MySQL to make the changes in database permanent?                                      
21While Creating a table ‘Customer’ Simrita forget the set of 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?
22 Write two SQL statement to set Autocommit to off.
23 Mention two sql commands on which an implicit commit takes place even if the autocommit is off.
24 Rama is not able to change a value in a column to NULL. What constraint must have been thr in the table.
25 In a student table, out of RollNumber, Name, Address which column can be set as Primary key and Why?
26  Define Inheritance with reference to Object Oriented Programming.                                                  
 27  Read the following case study and answer the questions that follow :
 The  Shop n Store has developed the following data entry screen for its operations. The store offers three different types of membership discount schemes for its regular customers. Platinum members get a discount of 10% on all their purchases, Gold members get 5% and Silver members get 3% discount.
           
a)Write the code to disable the text fields AmountTF, DiscountTF and NetTF.                    
b)Write the code for CalcBTN to calculate the amount, discount and net amount as per given  descp
c)Write the code for ExitBTN to close the application, but before the application is closed it should check the net amount and if the net amount  > 10,000 the membership of the customer should be upgraded and displayed. For example, if the customer already has Silver membership  it should be upgraded Gold membership (similarly from gold to platinum);informed of the same using a message box.
28Study the following tables Doctor and Salary and write SQL Commands                                         
    Table  : DOCTOR                                                                                            Table: SALARY
ID
NAME
DEPT
SEX
EXPERIENCE
ID
BASIC
ALLOWANCE
CONSULT
101
John
ENT
M
12
101
12000
1000
300
104
Smith
ORRHPEDIC
M
5
104
23000
2300
500
107
George
CARDIOLOGY
M
10
107
32000
4000
500
114
Lara
SKIN
F
3
114
12000
5200
100
109
K George
MEDICINE
F
9

109
42000
1700
200
105
Johnson
ORRHPEDIC
M
10
105
18900
1690
300
 117
Lucy
ENT
F
3
130
21700
2600
300
 111
Bill
MEDICINE
F
12

130
Morphy
ORRHPEDIC
M
15

(a). Display NAME of all doctors who are in “MEDICINE”  having more than 10 years experience and basic more than 10000.
 (b). Display the average of all doctors working in “ENT” department using the DOCTOR and where as   salary=basic + allowance.
(c). Display the minimum ALLOWANCE of female doctors.
(d). Display the highest consultation fee among all male doctors for orthopedic dept
(e) Find out avg salary for each department.
f) Find out number of doctors in each department and display only those department where number of doctors are less than 2.
g)This table was created in the year 2010. Update the experience of all the doctors accordingly.
  29 Write the resulting output of the following :                                                                                          
   (a). Select  SUBSTR(‘NetBeans IDE Programmer’, 10,3);
   (b). select INSTR(TRIM(‘        ABS Public School                    ‘),’S’);
   (c).select ( ROUND ( 125.60,1) ;    d). select LEFT(‘RAMESH SHARMA’ , 5);   (e). select ROUND(1045.439 , 2) ;
   f) Select round(760,-2);  g)Select null +5;   (h). select Round(740,-2);
30 Create table “Employee” as per following table Instance Chart.                                                                                        
Column Name
EmpID
EmpName
EmpAddress
EmpPhone
EmpSal
DeptID
Key Type
Primary
Primary




Nulls/Unique

NOT NULL

unique


Data Typa
NUMBER
VARCHAR
VARCHAR
VARCHAR
VARCHAR
VARCHAR
Length
6
20
30
10
9,2
2


No comments:

Post a Comment