Академический Документы
Профессиональный Документы
Культура Документы
(b) Computers can be put to use virtually in every possible field. Name any two 2
applications.
Ans. Some major applications are:
1. Reservation System
2. Hotel Management
3. Inventory
4. Payroll
5. Human Resource Management System
(c) (i) Define Serial port. 2
(ii)Name the Port which gives us an easier, single and standardized way to
connect a variety of devices to a computer.
(d) Suman wants to purchase a new printer. Please help her to buy a printer with 2
good resolutions, cheap, small, fast, quiet features. Write its disadvantages
also.
Ans. i) Ink Jet Printer – Suman Should buy Ink Jet Printer according to given
features.
Disadvantages of Ink Jet Printers are:
1) Slow as compare to Laser Printer.
2) Running cost is very high.
3) If left unused for long periods of time, the cartridges dry out.
(d) Can we use arithmetic expression with SELECT command? Explain with an 2
example.
Ans. If you want to perform simple numeric computations on the data to put it in
a form more appropriate to your needs, SQL allows you to place arithmetic
operators and constants among the selected fields.
c) Write the proper control name to design the form for the following 2
specification.
d) 2
Differentiate between the following :
i] jTextField and jLabel.
ii] jRadioButton and jCheckBox .
Ans. i] jTextField is editable control whereas jLabel is non-editable control.
ii] jRadioButton is round in shape whereas jCheckBox is square in shape.
e) What are these methods used for?
2
i] setText()
Ans. ii] getText()
setText(): It is used to set the text to display through the different
components.
getText(): It is used to return the value of text property.
f) Find the errors:
2
int sum=0;
for( int i=1,i<=5;++i)
{
sum+ i=sum;
}
jLabel2.setText(sum)
Ans.
Correct code Description
for( int i=1;i<=5;++i) 1) ; was missing in loop.
{ 2) Wrong expression
sum=sum+i; 3) Concatenation and ;
} was missing in
jLabel2.setText(“ “ +sum); statement.
DAV CMC has computerized its Salary Generation; the following is the data entry
form in Java used by them.
(a) On clicking Set Initial button Job Type should be Permanent and jTextField4, 2
jTextField5, jTextField6, jTextField7, jTextField8, jTextField9 should be non-
editable.
(b) On clicking the Calculate Salary button the Salary should be displayed based 8
on the following criteria:
DA : 60% of Basic
HRA : 30% of Basic
PF 10% of Basic (will be deducted)
IT 5% of gross
(c) Clicking the clear button will clear all the contents of jTextFields. 2
c) jTextField1.setText("");
jTextField2.setText("");
jTextField3.setText("");
jTextField4.setText("");
jTextField5.setText("");
jTextField6.setText("");
jTextField7.setText("");
jTextField8.setText("");
jTextField9.setText(“”);
d) System.exit(0);
Section C
Q6. Refer the table EMPLOYEE given below and write the SQL Commands for (i) 10
to (x)
Srno Name Extno Salary DOJ Dept Age Gen
der
1 Jugal 231 25400 2009-12-10 Marketing 35 M
2 Sharmila 232 17800 2009-10-08 HR 40 F
3 Rakesh 237 30000 2008-05-04 Finance 35 M
4 Shyam 235 38000 2008-06-05 IT 38 M
5 Sangeeta 236 28000 2009-06-08 IT 32 F
6 Shalakha 239 36000 2008-06-08 Finance 30 F
7 Sandeep 238 24000 2010-08-05 HR 28 M
8 Vikas 233 33000 2009-12-05 Marketing 31 M
9 Mohan 234 25000 2009-10-15 HR 32 M
10 Arun 240 27000 2009-12-15 Marketing 28 M
i) Create the table with appropriate data type.
ii) Display the different types of department.
iii) Display name and age of the employees who have joined in 2009 and
2010.
iv) Display all the information in descending order of Age.
v) Company has thought to raise their salary by 2%. Display name, sal
and raised salary by 2% as New Salary.
vi) The extension number of all the employees have changed and it is
added 2 before their old extension number. Write the command to
change their extension number in the table.
vii) Display name, dept, salary of female staff in ascending order of their
names.
viii) Add one more column as City.
ix) Company has decided to close IT department and get this work done
from a party outside on a contract basis. So, write the command to
remove all the employees of IT department.
Ans. (i) CREATE TABLE employee
(srno INTEGER,
name VARCHAR(30),
extno INTEGER,
salary INTEGER,
DOJ DATE,
dept VARCHAR(30),
age INTEGER,
gender CHAR
);
(ii) SELECT DISTINCT dept FROM employee;
(iii) SELECT name, age FROM employee WHERE doj > ’2090-01-01’;
(iv) SELECT name, sal, sal+(sal*0.02) as New Salary FROM employee;
(v) SELECT * FROM employee ORDER BY age DESC;
(vi) UPDATE employee SET extno=2000+extno;
(vii) SELECT name, dept, salary FROM employee WHERE gender=’F’
ORDER BY name DESC;
(viii) ALTER TABLE employee ADD City VARCHAR(30);
(ix) DELETE FROM employee WHERE dept=’IT’;