txtFacility.enable(false);
}
Double click on Calculate Rate button which will generate a
procedure called cmdRateActionPerformed and write the
following lines as given below:if (OptSingle.isSelected())
txtRate.setText(Integer.toString(1500));
else
if (OptDouble.isSelected())
txtRate.setText(Integer.toString(2800));
else
if (OptDelux.isSelected())
txtRate.setText(Integer.toString(5000));
Double click on Calculate Amount button which will generate a
procedure called
cmdAmountActionPerformed and write the
following lines as given below:if (chkTour.isSelected())
txtFacility.setText(Integer.toString(7000));
else
if (chkGym.isSelected())
txtFacility.setText(Integer.toString(2000));
else
if (chkLaundry.isSelected())
txtFacility.setText(Integer.toString(1000));
Double TAmount = (Double.parseDouble(txtRate.getText()) *
Double.parseDouble(txtDays.getText())) +
Double.parseDouble(txtFacility.getText());
txtAmount.setText(Double.toString(TAmount));
Double click on Exit button which will generate a procedure called
cmdExitActionPerformed and write the following lines as given
below:System.exit(0);
else
if (optPan.isSelected())
txtRate.setText(String.valueOf(260));
Double click on Calculate Amount button which will generate a
procedure called
cmdAmountActionPerformed and write the
following lines as given below:int Top = 0;
float Amt = 0;
if (chkCheese.isSelected())
{
Top = 40;
}
if (chkCap.isSelected())
{
Top = Top + 20;
}
if (chkPep.isSelected())
{
Top = Top + 25;
}
txtTop.setText(Integer.toString(Top));
Amt = (Integer.parseInt(txtRate.getText()) + Top) *
Integer.parseInt(txtQty.getText());
txtAmount.setText(Float.toString(Amt));
Double click on Exit button which will generate a procedure called
cmdExitActionPerformed and write the following lines as given
below:System.exit(0);
}
private void txtPrincipalActionPerformed(java.awt.event.ActionEvent evt) {
}
private void cmdCalculateActionPerformed(java.awt.event.ActionEvent evt) {
int T = Integer.parseInt(txtTime.getText());
double CI = 0, Amount =0;
double P = Double.parseDouble(txtPrincipal.getText());
float R = 0;
if (optFD.isSelected())
{
if (T<=1)
R = 10;
else
if ((T>1) && (T<=5))
R = 12;
else
if (T>5)
R = 15;
}
else
if (optRD.isSelected())
{
if (T<=2)
R = 10;
else
if ((T>2) && (T<=7))
R = 12;
else
if (T>7)
R = 15;
}
if (chkSR.isSelected())
R = R + 2;
txtRate.setText(Float.toString(R));
CI = P * Math.pow((1 + (R/100)), T);
Amount = P + CI;
txtInterest.setText(String.valueOf(CI));
txtAmount.setText(String.valueOf(Amount));
}
if (optVisa.isSelected())
discount = Amount * 9.5/100;
else
if (optAxis.isSelected())
discount = Amount * 10.5/100;
else
if (optSC.isSelected())
discount = Amount * 8.5/100;
else
if (optCity.isSelected())
discount = Amount * 11.5/100;
else
if (optSBI.isSelected())
discount = Amount * 8/100;
netamount = Amount - discount;
txtDisc.setText(String.valueOf(discount));
txtNet.setText(String.valueOf(netamount));
}
private void cmdExitActionPerformed(java.awt.event.ActionEvent
evt) {
System.exit(0);
}
private void cmdClearActionPerformed(java.awt.event.ActionEvent
evt) {
txtAmount.setText("");
txtDisc.setText("");
txtNet.setText("");
optSBI.setSelected(true);
}
{
txtArea.append("Code/No -> " + ecno + "\n");
txtArea.append("Name -> " + name + "\n");
txtArea.append("Address -> " + address + "\n");
txtArea.append("City -> " + city + "\n");
txtArea.append("State -> " + state + "\n");
}
}
class Employee extends Address
{
double salary, da, hra, gross;
Employee (double sal)
{
salary = sal;
}
void cal_salary()
{
da = 1.2 * salary;
hra = 0.15 * salary;
gross = salary + hra + da;
txtArea.append("Salary -> " + salary + "\n");
txtArea.append("DA -> " + da + "\n");
txtArea.append("HRA -> " + hra + "\n");
txtArea.append("Gross -> " + gross + "\n");
txtNet.setText(String.valueOf(gross));
}
}
class Customer extends Address
{
private int
acc_no;
private double balance;
Customer(double val)
{
balance = val;
}
void calc_int()
{
txtArea.append("Balance Amount -> " + balance + "\n");
balance = balance + (balance * 10/100);
txtArea.append("Total Balance Amount -> " + balance + "\n");
txtNet.setText(String.valueOf(balance));
}
}
private void cmdCalcActionPerformed(java.awt.event.ActionEvent evt) {
int no;
String name, address, city, state;
no = Integer.parseInt(txtNo.getText());
name = txtName.getText();
address = txtAdd.getText();
city = txtCity.getText();
state = txtSt.getText();
if (optEmp.isSelected())
{
double sal = Double.parseDouble(txtAmt.getText());
Employee emp = new Employee(sal);
emp.input_data(no, name, address, city, state);
emp.print_data();
emp.cal_salary();
}
if (optCust.isSelected())
{
double bal = Double.parseDouble(txtAmt.getText());
Customer cust = new Customer(bal);
cust.print_data();
cust.calc_int();
}
}
private void optEmpActionPerformed(java.awt.event.ActionEvent evt) {
jLabel6.setText("Salary");
jLabel7.setText("Gross");
txtNet.enable(false);
}
private void optCustActionPerformed(java.awt.event.ActionEvent evt) {
jLabel6.setText("Balance");
jLabel7.setText("Total Balance");
txtNet.enable(false);
}
private void cmdExitActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0);
}
txtAvg.setText(Float.toString(batavg));
}
}
private void btnAvgActionPerformed(java.awt.event.ActionEvent
evt) {
Batsman BT = new Batsman();
BT.readdata();
BT.displaydata();
}
private void btnExitActionPerformed(java.awt.event.ActionEvent evt)
{
System.exit(0);
}