Q1.Create a Java Desktop
Applicant to find the Discount of an item on the basis of Category of
item Electrical Appliance/Electronic Gadget /Stationery]. The Categories will
be implemented in JRadioButton controls. The discount will be calculated as
follows:
Cost
|
Discount (%)
|
<= 1000
otherwise
|
5
10
|
The extra Discount will be
calculated as follows:
Category
|
Discount (%)
|
Electrical Appliance
Electrical Gadget
Sttionery
|
3
2
1
|
Q2. Create a Java Desktop
Application to find the incentive (%) of Sales for a Sales Person on the basis
of following feedbacks:
Feedback
|
Incentive (%)
|
||||||||||||||||||||||||||||||||||||
Maximum Sales
Excellent Customer Feedback
Maximum Count Customer
|
10
8
5
(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 the given descriptions
and conditions.
(c) Write the code to remove
the decimal part from the text field NetTF so that the net amount contains only
the integer portion in Rupees. Where (in which event handler) would you place
this code to have its impact?
(d) 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
Q4)
(a) When the user select
different seat type, then its price should be displayed in the Label.
(b) If the user enters an
invalid no of seats i.e. less than I, then an error message should be displayed
in the dialog box.
( c) When the user click
at the Book Seats button , then total amount (calculated as no. of seats x
price per seat) should be displayed along with payment method, next to the push
button.
(c) Price per seat depend
upon the seat type :
Stall 625/-
Circle 750/-
Upper Circle 850/-
Box 1000/-
Q5)
Write the code for the
Clear button to clear all the textfields and checkbox. Set the default choice
in the radio button as Fixed Deposit.
(b) Write the code for the
calculate button to calculate compound interest and amount and display the
values in the txtInterest and txtAmount depending on principal, rate and time.
Rate is calculated based
on the time according to the following table:
Service
Charges Rates are as follows :
Write java code for the
following:
(a)To calculate service
charges depending on the selection of radio button. This code will execute
after click on the calculate service charges?
(b)To calculate net price
when Calculate Net price button will be clicked.
(c)When exit button will be clicked
application should be automatically closed.
Q8) Create a GUI application for a telecom company to calculate customer bill according to the rate charges given as below:
No of calls:
1-100 ------------ Rental /rs 500
101-200------------1 rs/call+ rental
201-300-------------1.20/call+rental
301 and above ------1.50/call+rental.
Give 10% discount to special customer
Q9) Create GUI application :
a) Find out sum of digits
b) Check whther a number is a palindrome or not
c) Check whther a number is even or not. If even . generate a factorial of the number.
d) Check whther the given number is prime or not.
Q10)
int I =0,x = 0;
for (I=0;I<5;++I)
for (I=0;j<i;j++) {
x += (I+j-1);
System.out.print(i + “ ” );
}
System.out.print(“\n +x );
}
int Number1 = 7,Number2=8;
int Second = 73;
if (Number1>0 ||
Number2>5)
if (Number1>7)
jTextField1.setText("Code
Worked");
else
jTextField1.setText("Code
MightWork");
else
jTextField1.setText("Code will not
Work");
int j=1, s=0;
while(j<10) {
System.out.println(J+ “+”);
s = s +j;
j = j + j % 3;
}
System.out.println(“=” + s);
v = 20 ;
do
{
JOptionPane.showMessageDialog(
null , v + “ ” ) ;
} while ( v< 50 ) ;
JOptionPane.showMessageDialog( null , “ Bye “
) ;
Identify the errors :
Int vowels, others;
Char ch=
jTextfield1.getText();
switch(ch)
{ case ‘a’ :
case ‘A’ :
case ‘e’ :
case ‘E’ :
case ‘i’ :
case ‘i’ :
case ‘u’ :
case ‘U’ : ++vowels;
break;
default : ++others;
}
Rewrite the following code
using while loop :
inti,j;
for(i=1;i<=4;i++)
{ for(j=1;j<=i;++j)
{ System.out.print(j);
}
System.out.println();
}
|
answer for question3
ReplyDelete