Saturday, 10 November 2012

TEST 2-NETBEANS GUI



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

Q3)
(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:
Account
Time
Rate    SCRate
Fixed Deposit
<= 1
10%     12%
>1 and <=5
12%                    14%
>5
15%                     17%
Recurring Deposit
<= 2
11%       13%
>2 and <=7
12%                      14%
>7
15%                      17%


       Q6)                    
Male and female labours are respectively paid Rs. 150/- per day and Rs. 170/- per day. Skilled labourers are paid extra at the rate of Rs. 100/- day. Male and female labourers from rural areas are paid 10% less per day.

(a) When Calculate Wage button is clicked, the total wages is calculated as per the given criteria and displayed in total wage text box.


(b) When Clear button is clicked, all the text boxes should be cleared and radio button, check box should be deselected.

(c) Close the application when Quit button is pressed. 

Q7)


Service Charges Rates are as follows :
Class of City
Rate of Service Charges
i
10% of sales price
ii
15% of sales price
iii
20% of sales price
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();
}


 


1 comment: