You are on page 1of 10

1Q.

Glamour Garments has developed a GUI application for their


company as shown below:

(i)
(ii)

Help in writing the java code for


To make the jTextField for Discount Amount uneditable and 3
jTextField for Net Amount and Calculate Net Amount jButton
, to be disabled as the application window opens.
On the click of jButton Calculate Discount, jTextField for 5
Discount Amount should display discount on bill amount on
the bases of Payment Mode as follows :
Mode of Payment
Discount %
Cash
8
Cheque
7
Credit Card
Nil

And if the bill amount is more than 15000 the customer gets
an additional discount of 10% on the bill amount and enable
Calculate Net Amount jButton .
(iii) On click of jButton Calculate Net Amount the net amount (bill 2
amount
- discount amount) should be displayed in the respective
jTextField
(iv) Write the code for Reset jButton to reset the jFrame
3
(v) Write the code for Exit jButton to close the application
1

2Q. Janav Raj is a the programmer at Path Educo Enterprises. He


created the following GUI in NetBeans.

Help in writing the java code for


(i)
To make the jTextArea clear and uneditable and Reset
jButton to be disabled as the application window opens.
(ii) On the click of jButton Display the Series, jTextArea should
display the series of even numbers or odd numbers based on
the Starting Number. And enable the Reset jButton
(iii) Write the code for Reset jButton to reset the jFrame
(iv) Write the code for Exit jButton to close the application after
displaying the message Thank You on a message Dialog
Box.

3
5
4
2

3Q. Richika is a programmer at Alpha builders to calculate the


wages to be paid to its laborers. She has designed the
following GUI in NetBeans

Help in writing the java code for


(i)
To make the jTextField for Total wages uneditable and Clear
jButton to be disabled as the application window opens.
(ii) On the click of jButton Calculate Wages , jTextField for Total
wages should display the amount to be paid on the bases
that Male and Female laborers are respectively paid at the
rate of Rs. 140/- per day and Rs. 160/- per day. And Skilled
laborers are paid extra at the rate of Rs. 50/- per day
irrespective of the gender. And enable the Clear jButton
(iii) Write the code for Clear jButton to reset the jFrame
(iv) Write the code for Exit jButton to close the application after
displaying the message Thank You on a message Dialog
Box.

2
6

4
2

4Q. Aditya the programmer at Edu De Enterprises has created


the following GUI in NetBeans.

(i)
(ii)
(iii)

Help in writing the java code for


To make the jTextFields for Total and Grade uneditable and 2
jButtons Get Grade and Reset to be disabled as the
application window opens.
On the click of jButton Get Total , jTextField for Total should 3
display the sum of all the marks obtained in various subjects
and enable the Get Grade jButton.
On the click of jButton Get Grade , jTextField for Grade 5
should display the grade on the criteria as follows :
Total Marks
Grade
Above 80
A
65 to 80
B
50 to 65
C
Below 50
D

and enable the Reset jButton.


(iii) Write the code for Reset jButton to reset the jFrame.
(iv) Write the code for Exit jButton to close the application .

3
1

5Q. Mr. Ram Kishore the owner of Kiddi Land Enterprise got the
GUI designed for his billing system as follows:

(i)

(ii)

Help him in java coding for the following :


To make the jTextFields for Discount, Additional Discount 2
and Net Amount uneditable and jButtons Calculate Net
Amount and Reset to be disabled as the application window
opens.
On the click of jButton Calculate Discount , the discount 5
amount and additional discount amount should be displayed
in respective jTextFields on the criteria
Card Type
Discount %
Platinum
20
Gold
15
Sliver
10

If the bill amount is more than 25000, an additional offer of


5% on bill amount is given. And enable the jButton Calculate
Net Amount.
(iii) On the click of jButton Calculate Net Amount, jTextField for 3
Net Amount should displayed as bill amount (discount +
additional discount)
and enable the Reset jButton
(iii) Write the code for Reset jButton to reset the jFrame.
3
(iv) Write the code for Exit jButton to close the application.
1

6Q. Mr. Rang swami works at a Recreation Park as a system


analyst. He has created the following GUI.

When a group arrives at the Recreation Park, the number of


people in the group and the whether the group wants to enjoy
the Water Park or not is entered. Entry fee is Rs.500 per
person. The person can choose to play at Water Park by
selecting the checkbox. Rides of Water Park will cost Rs.250
extra per person.
Help him to write code for the following:
(i)
Write Java code to make the jTextField for Total Amount
uneditable and jTextFields for Entry Fees, Water Park
Charges and jButton for Reset disabled and as the
application window opens.
(ii) Write Java code to display amount charged for the Water
Park for all the people in the group in the respective jTextField
when jCheckBox of Water Park is clicked.
(iii) On the click of jButton Calculate, jTextField for Entry Fees
should display amount for all the people in the group and
jTextField for Total Amount should display sum of Entry fees
and Water Park Charges.
(iv) Write Java code to Reset jButton to reset the jFrame.
(v) Write Java code to close the application on the click of Exit
jButton.

3
3

4
1

7Q. Ms. Rakhi works in an International Bank as an IT Head. She


designed a simple interest calculator program as shown
below.

(i)

(ii)

(iii)

Help her to write code for the following:


Write Java code to make the jTextFields for Interest Rate 3
uneditable and jTextField for Simple Interest Amount along
with Reset jButton should be made disabled as the
application window opens.
When jRadioButtons are clicked, the respective Interest Rate 3
should be displayed in the appropriate jTextField based on the
given criteria as shown :
Account Type
Interest Rate
%
Saving
4
Recurring Deposit 6
Fixed Deposit
8

When Simple Interest jButton is clicked , Simple Interest 3


Amount should be displayed in the appropriate jTextField
based on the formulae :
Simple Interest Amount = (Deposit Amount * Interest Rate *
Deposit Duration) / 100
(iv) When Clear All jButton is clicked, the jFrame should be reset. 4
(v) Write Java code to close the application on the click of Exit 1

jButton.

8Q. The students of Shiksha Vidyalaya work for different extra


curricular activities. The Programmer at school has developed
a GUI application as shown below and every student can
participate in more than one activity to secure 10 points for
each activity

Help him to write code for the following:


(i)
Write Java code to make the jTextFields for Community
Outreach Programme, Swachh Bharat Abhiyan and Traffic
Safety Club disabled and jTextField for Total Score uneditable
as the application window opens.
(ii) Write the java code to display the points scored in the
respective jTextFields as each activity is selected
(iii) When Calculate Total Score jButton is clicked, the Total score
(sum of the points scored) should be displayed in the
appropriate jTextField
(iv) When Clear jButton is clicked , to reset the jFrame
(v) When Close jButton is clicked, the application should close
after displaying the message Thank You on a message
Dialog Box.

3
4
3
2

9Q. Mr. Pawan works as a programmer in ABC Marketing


Company where he has designed Salary generator software
to generate the salary of salesman in which Name and Salary
are entered by the user. A screenshot of the same is shown
below:

(i)

(ii)
(iii)

Help him to write code for the following:


After selecting appropriate Radio Button, when Commission 4
button is clicked, commission should be displayed in the
respective text field as each Salesman will get a commission
based on the units sold according to the following criteria:

When Gross Salary button is clicked, Gross Salary should be 3


calculated and displayed in the respective text field as per the
given formula: Gross Salary= Salary + Commission
After required selection of Checkbox(es), when Facility 4
Charges button is clicked, Facility charges will be displayed in
the respective text field according to the following criteria:

(iv) Money will be deducted from the Gross Salary according to 3


the facilities opted by the employee. When Net Salary
button is clicked, Net Salary should be calculated and
displayed in the respective text field as per the given formula:
Net Salary= Gross Salary-Facilities Charges

You might also like