Documente Academic
Documente Profesional
Documente Cultură
Write a function to compute and display the amount in a text to be paid by the customer after
availing the discount. Notice that the amount should be as a double type parameter.
(c) Name a component that looks like a button and that, when pressed, brings up a menu of
items for the user to choose from.
[2]
(d) Design a HTML table as given below:
[2]
World Coffee Market
Country
Metric Tons
Bags 2007/8
2007/8
Brazil
17,000,000
36,070
Vietnam
15,580,000
18,000
Columbia
9,400,000
12,400
Indonesia
2,770,554
6,446
Ethiopia
1,705,446
5,733
Coffee Producers by Court
(e) Using method/function, develop a Java Program to calculate the Area of scalene triangle
using Heros formula.
[2]
3. (a) What is meant by cardinality of a table? Give an example.
[1]
(b) Mr. Krishna Swami is working on a database and has doubt about the concept of
SAVEPOINT in a transaction. Write down the meaning of SAVEPOINT and provide a simple
example considering yourself as an online web support executive.
[1]
(c) What is the difference between CREATE TABLE and ALTER TABLE commands
[1]
(d) Table STUDENT has 4 rows and 2 columns. Table MARKS has 2 rows and 3 columns. What
will be the cardinality and degree of the Cartesian product of STUDENT and MARKS?
[1]
(e) There is a column Salary in a table EMPLOYEE. The following two statements are giving
different outputs. What may be the possible reason?
[2]
SELECT COUNT (*) FROM EMPLOYEE;
SELECT COUNT (SALARY) FROM EMPLOYEE;
(f) Mr. Kapoor is a programmer at Ekansh Enterprise. He created 5 digit password and stored
in a string variable called strPassword. He wants to stored the same password in an Integer
type variable called intPassword. Write an appropriate Java statement to transfer the content
from strPassword to intPassword.
[2]
(g) Mrs. Kumar is using table STUDENTS with the following columns :
RAO, ADMNO, NAME, AGGREGATE
She wants to display all information of students in descending order of name and within
ascending order of aggregate. She wrote the following SQL query and she did not get the
desired output: SELECT * FROM STUDENTS ORDER BY NAME, AGGREGATE DESC;
Rewrite the above query to get the desired output.
[2]
4. (a) Common Wealth International is a bank. The bank provides three types of loan Car loan,
House loan, Education loan. The following is the Interest rate and discount calculation form.
Material downloaded from http://myCBSEguide.com and http://onlineteachers.co.in
Portal for CBSE Notes, Test Papers, Sample Papers, Tips and Tricks
A JPanel container is used for Loan type with jRadioButton controls as follow:
jRadioButton1 : Car Loan (optCar) with buttonGroup1
jRadioButton2 : House Loan (optHouse) with buttonGroup1
jRadioButton2 : Education Loan (optEdu) with buttonGroup1
Enter the loan amount (txtLAmount) in the text box and do the following :
(i) Write the code for clear button (named as cmdClear) to clear all the text boxes and set car
loan as default loan type.
[1]
(ii) Write the code for Show Interest Amount button (named as btnShowInt) to show the
interest rate (txtRate) according to the following criteria:
[1]
Car Loan 10%
House loan 8.5%
Education loan 5%
(iii) Write the code for Calculate Discount button (named as btnCalcDisc) to find the Discount
amount (txtDisc). Notice that the bank provides discount on loan amount according to
following criteria.
[2]
If loan amount < = Rs10,000,00 then discount amount is 0.20% of loan amount.
If loan amount > Rs 10,000,00 then discount amount is 0.25% of loan amount.
The Net Amount = Interest Discount Amount.
(b) Mr. Rangaswami works at a Recreation Park as a system analyst. He has created the
following GUI. When a group arrives at the Recreation Park, the no of people in the group and
whether the group wants to enjoy the Water Park or not is entered. Entry fee is 500 per
person. The person can choose to play at Water Park by selecting the checkbox. Rides of Water
Park will cost 250 extra per person.
(i) Write a code to disable textfields(jTextField2, jTextField3 and jTextField4) when the
program is executed.
(ii) On the click of command button Calculate , textfield for entry fees should display Entry
Fees per person x Number of People. if Water Park checkbox is selected, textfield for water
charges should display Water Park charges per person x Number of people. Text Field for
total amount should display sum of entry fees and Water Park charges for all the people in
group.
[2]
(iii) Write Java code to clear all textboxes on the click of Clear Button and all text boxes
contain 0.
[1]
(iv)Write Java code to close the application on the click Exit Button with appropriate
message dialog box.
[1]
(c) What will be the output of the following program
[1+1]
(i) int x, y;
x = 5;
y = 1;
while (x > 0) {
x = x - 1;
y = y * x;
jTextArea1.append(String.valueOf(y) + \n);
}
(ii) int i = 0, x = 0;
for ( i = 1; i < 10; i *=2)
{
x++;
jTextArea1.append (String.valueOf(x));
(d) The following code has some error(s). Rewrite the correct code and underline all the
corrections made:
[1+1]
(i) int Sum=0, Step=5;
int I;
for(i=0; i<=5; i++)
{
Step += 5;
Ssum +=Step;
}
jTextArea.showText( +Sum);
(ii) Int P = 3, sum = 0;
{
sum = p;
P += 3;
Material downloaded from http://myCBSEguide.com and http://onlineteachers.co.in
Portal for CBSE Notes, Test Papers, Sample Papers, Tips and Tricks
}
while ( p =< 12)
jTextField1(Integer.tostring(sum));
(e) Rewrite the following program code using a if statement.
(i) int C=jComboBox1.getSelectedIndex( );
switch(C)
{
case 0 : FinalAmt=BillAmt ; break;
case 1 : FinalAmt=0.9 * BillAmt ; break;
case 2 : FinalAmt=BillAmt * 0.8 ; break;
default : FinalAmt=BillAmt ;
}
[1+1]
[1]
[1]
[1]
(iv) List the minimum and maximum amount from the BANK.
(v) SELECT CNAME , AMOUNT FROM BANK WHERE BNAME LIKE S%;
(vi) SELECT COUNT (DISTINCT BNAME) FROM BANK;
(vii) SELECT BNAME, SUM (AMOUNT) FROM BANK
GROUP BY BNAME HAVING COUNT(*) < 3;
(viii) SELECT MAX ( AMOUNT) FROM BANK WHERE AMOUNT > 30000;
6. (a) Write SQL Command to create the table Toyz with the following structure and
constraint:
Table: Toys
Column Name
Data Type (Size)
Constraint
Toy_no
Int (10)
Primary Key
Toy_name
Varchar (20)
Type
Char (10)
Price
Decimal (8, 2)
Colour
Varchar (15)
Default Red
[1]
[1/2]
[1/2]
[1/2]
[1/2]
[2]
(b) In a Database SAMS and VENDOR are two tables with the following information. Write
MySQL queries for (i) to (iii), based on tables SAMS and VENDOR.
Icode
S001
S002
S003
S004
S005
IName
Refrigerator
Mobile Phone
LCD
Washing
Machine
Air Conditioner
Table: SAMS
Price
20000
45000
65000
12500
16000
Colour
Blue
Black
Silver
Smoke
VCode
P01
P02
Op03
P01
White
P03
Table : VENDOR
VCode
VName
P01
Satish
P02
Manoj
P03
Subodh
P04
Jacob
(i) To display ICode , IName and VName of all the vendors, who manufacture Refrigerator.
[2]
(ii) To display IName, VName and Price of all the products whose price is more than 20000.
[2]
(iii) To display vendor names and names of all items manufactured by vendor whose item
code is P03.
[2]
(iv) With reference to SAMS table, which column should be set as the Primary Key? Which
column is foreign key? Give reasons.
[2]
7. (a) Define e-Business. Name one popularly used e-Business web site.
[2]
(b) How does e-governannce help in reducing corruption. Write two points.
[2]
(c) Suruchi works for a Shopping Mart. She wants to create controls on a form for the following
operations :
Choose most appropriate controls out of Text Box, Label, Radio Button, List Box, combo Box,
Check Box and Command Button.
[1]
S. No Function
Control Name
1
Enter the Item Code
2
Select Item Size (from list of sizes)
3
Enter Quantity
4
Submit the form
(d) Study the following data for patient table and answer the question that follows:
Table : Patient
Name P_no
Date_Adm
Doc_no
Mohan P_101
2006_03_21
301
Priya
P_204
2006_04_03
134
Suraj
P_375
2006_01_15
204
Komal P_424
2006_06_24
134
Suggest the data types and width that should be used for each of the fields in the above.
[1]